canvas layer: +prevent null layer objects. 53/231853/1
authorHermet Park <chuneon.park@samsung.com>
Fri, 24 Apr 2020 12:11:27 +0000 (21:11 +0900)
committerHermet Park <chuneon.park@samsung.com>
Fri, 24 Apr 2020 12:13:02 +0000 (21:13 +0900)
Change-Id: I7a822d314ee16e984db25aa0180b61affa0cdd8c

src/lib/evas/canvas/evas_stack.x

index 333932f4bd755e38170f65ea3550db5fde980dc1..ddd3dffbcb649cf7ca2e0104b2623d903752f870 100644 (file)
@@ -402,18 +402,20 @@ _evas_canvas_object_top_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
 
    //just in case if layer has no valid objects in the list.
    EINA_INLIST_REVERSE_FOREACH(list, layer)
-     if (layer->objects) break;
+     {
+        if (!layer->objects) continue;
 
-   list = EINA_INLIST_GET(layer->objects);
-   if (!list) return NULL;
+        list = EINA_INLIST_GET(layer->objects);
+        if (!list) return NULL;
 
-   obj = (Evas_Object_Protected_Data *) list->last;
-   if (!obj) return NULL;
+        obj = (Evas_Object_Protected_Data *) list->last;
+        if (!obj) return NULL;
 
-   while (obj)
-     {
-        if (!obj->delete_me) return obj->object;
-        obj = evas_object_below_get_internal(obj);
+        while (obj)
+          {
+             if (!obj->delete_me) return obj->object;
+             obj = evas_object_below_get_internal(obj);
+          }
      }
 
    return NULL;