From a39fc65ec9869e8b8905fffb535f94882f2f6778 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:01:32 +0000 Subject: [PATCH] fix unauthorised access crash when saving jsons --- Bloxstrap/JsonManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/JsonManager.cs b/Bloxstrap/JsonManager.cs index 58a1e25..a713d4f 100644 --- a/Bloxstrap/JsonManager.cs +++ b/Bloxstrap/JsonManager.cs @@ -65,7 +65,7 @@ namespace Bloxstrap { 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.WriteException(LOG_IDENT, ex);