From 0a06ddd9e3398749007deddf392d255f04347822 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Thu, 15 Nov 2012 00:53:03 +0100 Subject: [PATCH] wIconUpdate wwin checks The variable wwin is only used in one block of the if, so should be moved inside this block. OTOH, is better check if the variabl exists before assign it. The code now is more stable and avoid crashes. --- src/icon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/icon.c b/src/icon.c index 0edf53cb..e745619f 100644 --- a/src/icon.c +++ b/src/icon.c @@ -599,11 +599,14 @@ static void unset_icon_image(WIcon *icon) void wIconUpdate(WIcon *icon, RImage *image) { - WWindow *wwin = icon->owner; + WWindow *wwin = NULL; if (image) { icon->file_image = image; } else { + if (icon && icon->owner) + wwin = icon->owner; + if (wwin && WFLAGP(wwin, always_user_icon)) { /* Forced use user_icon */ get_rimage_icon_from_user_icon(icon); -- 2.11.4.GIT