diff --git a/src/switchpanel.c b/src/switchpanel.c index 3bfd5a01..e4674434 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -134,11 +134,11 @@ static void changeImage(WSwitchPanel *panel, int index, int selected) WMPixmap *pixmap= NULL; WMLabel *label = WMGetFromArray(panel->icons, index); RImage *image= WMGetFromArray(panel->images, index); - WMScreen *wscr = WMWidgetScreen(label); - if (image) { + if (image && label) { RColor bgColor; RImage *back; + WMScreen *wscr= WMWidgetScreen(label); if (selected) { back= RCloneImage(panel->tile); @@ -161,7 +161,7 @@ static void changeImage(WSwitchPanel *panel, int index, int selected) } } - if (pixmap) { + if (pixmap && label) { WMSetLabelImage(label, pixmap); WMSetLabelImagePosition(label, WIPImageOnly); WMReleasePixmap(pixmap);