From 326f2f531e0c50085a209684250429f6e99ac123 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 29 May 2019 09:25:14 -0400 Subject: [PATCH] efl_ui/image: check image object existence before using it in sizing Summary: when triggered before the image is loaded, this code cannot be run @fix Depends on D8978 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8979 --- src/lib/elementary/efl_ui_image.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index 11305e9..b4abeec 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -820,17 +820,15 @@ _efl_ui_image_sizing_eval(Evas_Object *obj) evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); - //Retained way. Nothing does, if either way hasn't been changed. - if (!sd->edje) + if (sd->img) { - efl_gfx_image_orientation_set(sd->img, sd->orient); - } + //Retained way. Nothing does, if either way hasn't been changed. + if (!sd->edje) + efl_gfx_image_orientation_set(sd->img, sd->orient); - if (sd->img) - { - _image_sizing_eval(sd, sd->img); - if (sd->prev_img) _image_sizing_eval(sd, sd->prev_img); - } + _image_sizing_eval(sd, sd->img); + if (sd->prev_img) _image_sizing_eval(sd, sd->prev_img); + } } static void -- 2.7.4