Browse Source

Handle individual malformed settings

Skip deserialization (or use default) instead of resetting all settings.
Daniel Chalmers 2 years ago
parent
commit
5a39333f11
1 changed files with 5 additions and 1 deletions
  1. 5 1
      DesktopClock/Properties/Settings.cs

+ 5 - 1
DesktopClock/Properties/Settings.cs

@@ -16,7 +16,11 @@ public sealed class Settings : INotifyPropertyChanged, IDisposable
 
     private static readonly JsonSerializerSettings _jsonSerializerSettings = new()
     {
-        Formatting = Formatting.Indented
+        Formatting = Formatting.Indented,
+        Error = (_, e) =>
+        {
+            e.ErrorContext.Handled = true;
+        },
     };
 
     private Settings()