fix unauthorised access crash when saving jsons

This commit is contained in:
bluepilledgreat 2024-12-08 12:01:32 +00:00
parent 3f61518f11
commit a39fc65ec9

View File

@ -65,7 +65,7 @@ namespace Bloxstrap
{ {
File.WriteAllText(FileLocation, JsonSerializer.Serialize(Prop, new JsonSerializerOptions { WriteIndented = true })); File.WriteAllText(FileLocation, JsonSerializer.Serialize(Prop, new JsonSerializerOptions { WriteIndented = true }));
} }
catch (IOException ex) catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{ {
App.Logger.WriteLine(LOG_IDENT, "Failed to save"); App.Logger.WriteLine(LOG_IDENT, "Failed to save");
App.Logger.WriteException(LOG_IDENT, ex); App.Logger.WriteException(LOG_IDENT, ex);