efl_ui_grid: Fix dereferencing null pointer

Summary:
Coverity reports EFL_UI_GRID_ITEM_DATA_GET can return NULL (checked
273 out of 281 times). As such, we should verify that 'id' is not NULL
here before trying to dereference it.

Fixes Coverity CID1397000

@fix

Depends on D8318

Reviewers: raster, cedric, q66, zmike, bu5hm4n, stefan

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8319
This commit is contained in:
Christopher Michael 2019-03-14 07:22:44 -04:00
parent 881b72f40d
commit 27095e859a
1 changed files with 1 additions and 0 deletions

View File

@ -167,6 +167,7 @@ _reposition(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan)
EINA_LIST_FOREACH(pd->items, l, item)
{
EFL_UI_GRID_ITEM_DATA_GET(item, id);
if (!id) continue;
ipos.x = id->geo.x - pan.x;
ipos.y = id->geo.y - pan.y;