entrance: Fix a possible NULL reference !
This commit is contained in:
parent
b5d2f926a7
commit
56cd1d8841
|
@ -633,6 +633,7 @@ _entrance_gui_user_icon_random_get(Evas_Object *obj, const char *username)
|
||||||
Eina_List *user_icons, *sys_icons, *theme_icons;
|
Eina_List *user_icons, *sys_icons, *theme_icons;
|
||||||
|
|
||||||
el = entrance_gui_user_get(username);
|
el = entrance_gui_user_get(username);
|
||||||
|
if (el)
|
||||||
user_icons = el->icon_pool;
|
user_icons = el->icon_pool;
|
||||||
sys_icons = entrance_gui_icon_pool_get();
|
sys_icons = entrance_gui_icon_pool_get();
|
||||||
theme_icons = entrance_gui_theme_icons();
|
theme_icons = entrance_gui_theme_icons();
|
||||||
|
@ -640,7 +641,7 @@ _entrance_gui_user_icon_random_get(Evas_Object *obj, const char *username)
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
rnd = (((eina_list_count(user_icons) + eina_list_count(sys_icons) + eina_list_count(theme_icons))
|
rnd = (((eina_list_count(user_icons) + eina_list_count(sys_icons) + eina_list_count(theme_icons))
|
||||||
* (double)rand()) / (RAND_MAX + 1.0));
|
* (double)rand()) / (RAND_MAX + 1.0));
|
||||||
if (rnd < eina_list_count(user_icons))
|
if ((el) && (rnd < eina_list_count(user_icons)))
|
||||||
{
|
{
|
||||||
o = elm_icon_add(obj);
|
o = elm_icon_add(obj);
|
||||||
img = eina_list_nth(user_icons, rnd);
|
img = eina_list_nth(user_icons, rnd);
|
||||||
|
|
Loading…
Reference in New Issue