From 28f185d8016ccfb01b326a528ff0c54ca791a824 Mon Sep 17 00:00:00 2001 From: kojima Date: Sun, 3 Oct 1999 18:35:25 +0000 Subject: [PATCH] fixed crash in appearances section --- WPrefs.app/Appearance.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 9ebf7982..c37fdebe 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -1259,6 +1259,14 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMColor *black = WMBlackColor(scr); TextureListItem *titem; + item = WMGetListItem(lPtr, index); + titem = (TextureListItem*)item->clientData; + if (!titem) { + WMReleaseColor(white); + WMReleaseColor(black); + return; + } + width = rect->size.width; height = rect->size.height; x = rect->pos.x; @@ -1269,13 +1277,11 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state, else XClearArea(dpy, d, x, y, width, height, False); - item = WMGetListItem(lPtr, index); - titem = (TextureListItem*)item->clientData; if (titem->preview) - XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0, TEXPREV_WIDTH, - TEXPREV_HEIGHT, x + 5, y + 5); - + XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0, + TEXPREV_WIDTH, TEXPREV_HEIGHT, x + 5, y + 5); + if ((1 << WMGetPopUpButtonSelectedItem(panel->secP)) & titem->selectedFor) WMDrawPixmap(panel->onLed, d, x + TEXPREV_WIDTH + 10, y + 6); else if (titem->selectedFor)