[layout] Add NULL check in _elm_layout_text_set function 98/77298/3
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 29 Jun 2016 09:28:54 +0000 (18:28 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 30 Jun 2016 05:53:13 +0000 (22:53 -0700)
When the parameter 'text' is NULL in elm_layout_text_set function,
the sub object data with the same part name is removed
from the layout's sub object list and the function returns immediately.
However, if the text part doesn't exist in the list,
a new sub object data is appended to the list even though the text is NULL.
This patch adds NULL check so the function can return in such cases.

Change-Id: Ia3a26864acc7139e530839b542ba00fc454667a8
Signed-off-by: Jaeun Choi <jaeun12.choi@samsung.com>
src/lib/elm_layout.c

index f4d928cc42630a765523bbeaaea06a22a1838dec..ab84a4a49fb7d9ad940063653aa0c774dd8ab794 100644 (file)
@@ -1162,6 +1162,8 @@ _elm_layout_text_set(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, const
         sub_d = NULL;
      }
 
+   if (!text) return EINA_TRUE;
+
    if (!edje_object_part_text_escaped_set
          (wd->resize_obj, part, text))
      return EINA_FALSE;