evas stack: ++safe code. 71/235871/1
authorHermet Park <chuneon.park@samsung.com>
Wed, 10 Jun 2020 11:30:19 +0000 (20:30 +0900)
committerHermet Park <chuneon.park@samsung.com>
Wed, 10 Jun 2020 11:32:33 +0000 (20:32 +0900)
null check to prevent any crashes (just in case)

Change-Id: Ic77a2c785feba9be32eb1460439f4c3315087e07

src/lib/evas/canvas/evas_stack.x

index ddd3dff..ae39b65 100644 (file)
@@ -152,6 +152,8 @@ _efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_D
    if (eo_obj == eo_above) return;
    if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_STACK_ABOVE, 1, eo_above)) return;
    Evas_Object_Protected_Data *above = efl_data_scope_get(eo_above, EFL_CANVAS_OBJECT_CLASS);
+   if (!above) return;
+
    if ((EINA_INLIST_GET(obj))->prev == EINA_INLIST_GET(above))
      {
         evas_object_inform_call_restack(eo_obj, obj);
@@ -242,6 +244,8 @@ _efl_canvas_object_efl_gfx_stack_stack_below(Eo *eo_obj, Evas_Object_Protected_D
    if (eo_obj == eo_below) return;
    if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_STACK_BELOW, 1, eo_below)) return;
    Evas_Object_Protected_Data *below = efl_data_scope_get(eo_below, EFL_CANVAS_OBJECT_CLASS);
+   if (!below) return;
+
    if ((EINA_INLIST_GET(obj))->next == EINA_INLIST_GET(below))
      {
         evas_object_inform_call_restack(eo_obj, obj);