From: Jihoon Kim Date: Wed, 27 Apr 2016 06:58:26 +0000 (+0900) Subject: edje_entry: fix crash issue in case of no selection text X-Git-Tag: accepted/tizen/common/20160428.144255^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F67525%2F2;p=platform%2Fupstream%2Fefl.git edje_entry: fix crash issue in case of no selection text Change-Id: I90362a605cdaa10a64548003852e4448ba81c984 --- diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index c86057b..77051df 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -4676,6 +4676,7 @@ _edje_entry_imf_retrieve_selection_cb(void *data, Ecore_IMF_Context *ctx EINA_UN Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en = NULL; + const char *selection_text = NULL; if (!rp) return EINA_FALSE; if ((rp->type != EDJE_RP_TYPE_TEXT) || @@ -4688,9 +4689,12 @@ _edje_entry_imf_retrieve_selection_cb(void *data, Ecore_IMF_Context *ctx EINA_UN if (en->have_selection) { + selection_text = _edje_entry_selection_get(rp); + if (text) - *text = strdup(_edje_entry_selection_get(rp)); - return EINA_TRUE; + *text = selection_text ? strdup(selection_text) : NULL; + + return selection_text ? EINA_TRUE : EINA_FALSE; } else return EINA_FALSE;