From 5c9b3233cdac45061b0fb59816205d93981b521e Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 14 Jul 2019 10:50:09 +0200 Subject: [PATCH] Fix bug overwriting settings default values on first load. --- ILSpy/Options/DecompilerSettingsPanel.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ILSpy/Options/DecompilerSettingsPanel.xaml.cs b/ILSpy/Options/DecompilerSettingsPanel.xaml.cs index c1c734173..134f9faf0 100644 --- a/ILSpy/Options/DecompilerSettingsPanel.xaml.cs +++ b/ILSpy/Options/DecompilerSettingsPanel.xaml.cs @@ -54,7 +54,9 @@ namespace ICSharpCode.ILSpy.Options var properties = typeof(Decompiler.DecompilerSettings).GetProperties() .Where(p => p.GetCustomAttribute()?.Browsable != false); foreach (var p in properties) { - p.SetValue(newSettings, (bool?)e.Attribute(p.Name) ?? true); + var value = (bool?)e.Attribute(p.Name); + if (value.HasValue) + p.SetValue(newSettings, value.Value); } return newSettings; }