From af278923ceaffb10a81b56f6f7fd8713bc3073d0 Mon Sep 17 00:00:00 2001 From: Khang Yeen Lee Date: Thu, 10 Sep 2015 13:50:32 +0200 Subject: [PATCH] #16. Show stopper fix to prevent a lock up. --- HudsonTrayTracker/BusinessComponents/ConfigurationService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HudsonTrayTracker/BusinessComponents/ConfigurationService.cs b/HudsonTrayTracker/BusinessComponents/ConfigurationService.cs index 7bfa4c9..ad2cffb 100644 --- a/HudsonTrayTracker/BusinessComponents/ConfigurationService.cs +++ b/HudsonTrayTracker/BusinessComponents/ConfigurationService.cs @@ -187,7 +187,10 @@ public string GetSoundPath(string status) public void SetSoundPath(string status, string path) { PropertyInfo prop = NotificationSettings.GetType().GetProperty(status + "SoundPath"); - if( prop.GetValue(NotificationSettings, null).ToString().CompareTo(path) != 0 ) + object obj = prop.GetValue(NotificationSettings, null); + + // obj == null, is to allow NOTHING to be set to the status. + if (obj == null || obj.ToString().CompareTo(path) != 0) { prop.SetValue(NotificationSettings, path, null); SaveConfiguration();