summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-03 10:55:40 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-03 18:36:25 +0200
commita26efaeb57f7d2e196d002480952312c20d02267 (patch)
tree2f7d6033344b1dbe33b1a9d06dcf4c35d97322b5
parent36eff7ed82a6d5dc1944dc6b03278c5bb9a7796d (diff)
efl_ui_position_manager_grid: honor NULL objects
its sometimes possible that there is a NULL object returned by the batch call. We should not just access the NULL element. Additionally, if NULL was returned during visibility setting, we need to set visibility here. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9827
-rw-r--r--src/lib/elementary/efl_ui_position_manager_grid.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_position_manager_grid.c b/src/lib/elementary/efl_ui_position_manager_grid.c
index 92d495efc4..ba48f376cc 100644
--- a/src/lib/elementary/efl_ui_position_manager_grid.c
+++ b/src/lib/elementary/efl_ui_position_manager_grid.c
@@ -302,8 +302,12 @@ _position_items_vertical(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data
302 { 302 {
303 _place_grid_item(&geom, pd, x, y); 303 _place_grid_item(&geom, pd, x, y);
304 } 304 }
305 305 Efl_Gfx_Entity *item = obj_buffer[buffer_id].entity;
306 efl_gfx_entity_geometry_set(obj_buffer[buffer_id].entity, geom); 306 if (item)
307 {
308 efl_gfx_entity_geometry_set(item, geom);
309 efl_gfx_entity_visible_set(item, EINA_TRUE);
310 }
307 } 311 }
308} 312}
309 313
@@ -369,7 +373,12 @@ _position_items_horizontal(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Dat
369 { 373 {
370 _place_grid_item(&geom, pd, x, y); 374 _place_grid_item(&geom, pd, x, y);
371 } 375 }
372 efl_gfx_entity_geometry_set(obj_buffer[buffer_id].entity, geom); 376 Efl_Gfx_Entity *item = obj_buffer[buffer_id].entity;
377 if (item)
378 {
379 efl_gfx_entity_geometry_set(item, geom);
380 efl_gfx_entity_visible_set(item, EINA_TRUE);
381 }
373 } 382 }
374} 383}
375 384