efl_ui_win: do not error when NULL is setted as content
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Wed, 17 Apr 2019 16:52:31 +0000 (18:52 +0200)
committerYeongjong Lee <yj34.lee@samsung.com>
Wed, 24 Apr 2019 05:24:47 +0000 (14:24 +0900)
NULL is valid, and the sub_object code does refuse to allow NULL, hence
we need this check here.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8638

src/lib/elementary/efl_ui_win.c

index 424cc59..83fc582 100644 (file)
@@ -8630,7 +8630,7 @@ _efl_ui_win_content_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, Eo *cont
    if (eina_streq(part, "content"))
      {
         if (sd->content == content) return EINA_TRUE;
-        if (!elm_widget_sub_object_add(obj, content))
+        if (content && !elm_widget_sub_object_add(obj, content))
           goto err;
         /* FIXME: Switch to swallow inside the frame
         if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", content))