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.
This commit is contained in:
Rodolfo García Peñas (kix) authored and Carlos R. Mafra committed 2012-11-17 20:38:45 +01:00
1 parent 4b4c5513ce
commit 0a06ddd9e3
1 file changed
+4 -1
+4 -1
View File
@@ -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);