From 66ec682107567e5305f509c655e0c7972eff0986 Mon Sep 17 00:00:00 2001 From: kojima Date: Mon, 18 Oct 2004 02:36:32 +0000 Subject: [PATCH] fixed a crash --- src/switchpanel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.11.4.GIT