Skip to content

Commit

Permalink
Don't crash app on failure to save settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryx93 committed Apr 4, 2023
1 parent 5cbdaea commit 5ef118a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Common.Services/Utilities/SettingsProviderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ public void Save(string path)
if (Value == null) { throw new NullReferenceException(Resources.GenericSettingsProviderCurrentNull); }
if (Value.Validate() != null) { throw new ValidationException(Resources.GenericSettingsProviderValidationErrors); }

_serialization.SerializeToFile(Value, path, _serializerContext);
try
{
_serialization.SerializeToFile(Value, path, _serializerContext);
}
catch
{
// Don't crash on failure to save.
}
}

/// <summary>
Expand Down

0 comments on commit 5ef118a

Please sign in to comment.