api: handle null string in buffer_add_highlight

This commit is contained in:
Björn Linse
2016-08-16 21:55:37 +02:00
parent c9b29d3884
commit 57ac9b0934
2 changed files with 7 additions and 3 deletions

View File

@@ -691,7 +691,7 @@ Integer buffer_add_highlight(Buffer buffer,
col_end = MAXCOL;
}
int hlg_id = syn_name2id((char_u*)hl_group.data);
int hlg_id = syn_name2id((char_u *)(hl_group.data ? hl_group.data : ""));
src_id = bufhl_add_hl(buf, (int)src_id, hlg_id, (linenr_T)line+1,
(colnr_T)col_start+1, (colnr_T)col_end);
return src_id;