layout: Add NULL check in _elm_layout_text_set function
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 29 Jun 2016 07:15:46 +0000 (16:15 +0900)
committerJaeun Choi <jaeun12.choi@samsung.com>
Wed, 29 Jun 2016 07:15:46 +0000 (16:15 +0900)
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.

src/lib/elementary/elm_layout.c

index aabbb56..919b75b 100644 (file)
@@ -1300,6 +1300,8 @@ _elm_layout_text_set(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, const
          (wd->resize_obj, part, text))
      return EINA_FALSE;
 
+   if (!text) return EINA_TRUE;
+
    if (!sub_d)
      {
         sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);