From f863dafef19cb202a82a1871a532bb5bb8f4fa53 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Fri, 12 Apr 2013 02:46:12 +0100 Subject: [PATCH] WPrefs: Avoid crash when config file does not contain wmdrawer settings When first using the wmdrawer panel of WPrefs the settings ClipAutoexpandDelay ClipAutocollapseDelay ClipAutoraiseDelay ClipAutolowerDelay are not yet saved in the user's config file and 'value' ends up being undefined in showData() leading to a crash in adjustButtonSelectionBasedOnValue(). This patch is a workaround to make it possible to choose the config values for the first time using WPrefs. --- WPrefs.app/Docks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WPrefs.app/Docks.c b/WPrefs.app/Docks.c index 211462d1..4638b674 100644 --- a/WPrefs.app/Docks.c +++ b/WPrefs.app/Docks.c @@ -77,6 +77,10 @@ static void pushAutoDelayButton(WMWidget *w, void *data) static void adjustButtonSelectionBasedOnValue(_Panel *panel, int row, char *value) { int j; + + if (!value) + return; + for (j = 0; j < 5; j++) { int isThatOne = !strcmp(autoDelayPresetValues[j], value);