elm_colorselector: avoid calling functions with null objects
authorMike Blumenkrantz <zmike@samsung.com>
Tue, 19 Jun 2018 17:41:16 +0000 (13:41 -0400)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 19 Jun 2018 21:45:48 +0000 (06:45 +0900)
Summary:
a number of calls during construction resulted in null object errors here

fix T7036

Depends on D6323

Reviewers: bu5hm4n, Hermet, woohyun, devilhorns

Reviewed By: bu5hm4n

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7036

Differential Revision: https://phab.enlightenment.org/D6324

src/lib/elementary/elm_colorselector.c

index b96c827..4cd1a73 100644 (file)
@@ -1545,6 +1545,7 @@ _elm_colorselector_elm_layout_sizing_eval(Eo *obj, Elm_Colorselector_Data *sd)
    Evas_Coord minw = -1, minh = -1;
 
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+   if (!efl_finalized_get(obj)) return; //not constructed yet
 
    elm_coords_finger_size_adjust(1, &minw, 1, &minh);
 
@@ -1996,14 +1997,13 @@ _create_colorpalette(Evas_Object *obj)
    if (sd->palette_box) return;
    if (elm_widget_is_legacy(obj))
      {
-        sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj,
-                                         _palette_box_prepare(efl_added));
+        sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj);
      }
    else
      {
-        sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj,
-                                  _palette_box_prepare(efl_added));
+        sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj);
      }
+   _palette_box_prepare(sd->palette_box);
 
    hpadstr = edje_object_data_get(wd->resize_obj, "horizontal_pad");
    if (hpadstr) h_pad = atoi(hpadstr);