edc_editor: ++safety

don't access null pointer.
This commit is contained in:
Hermet Park 2019-08-19 17:18:07 +09:00
parent 514708d908
commit 0d1a9621f6
1 changed files with 3 additions and 4 deletions

View File

@ -231,16 +231,15 @@ syntax_color_apply(edit_data *ed, Eina_Bool partial)
{ {
Evas_Object *tb = elm_entry_textblock_get(ed->en_edit); Evas_Object *tb = elm_entry_textblock_get(ed->en_edit);
char *text = (char *) evas_object_textblock_text_markup_get(tb); char *text = (char *) evas_object_textblock_text_markup_get(tb);
if (!text) return EINA_FALSE;
int text_len = strlen(text); int text_len = strlen(text);
//FIXME: We encountered a syntax coloring issue that won't be applied //FIXME: We encountered a syntax coloring issue that won't be applied
//at the opening an edc script. The situation condition is below, //at the opening an edc script. The situation condition is below,
//and we try syntax coloring again in that case. Work around logic, //and we try syntax coloring again in that case. Work around logic,
//but it works. //but it works.
if (text && (text_len == 0)) if (text_len == 0) return EINA_FALSE;
{
return EINA_FALSE;
}
int from_line = 1; int from_line = 1;
int to_line = -1; int to_line = -1;