diff --git a/ZuneModCore/ModManager.cs b/ZuneModCore/ModManager.cs index fcb288c..7f2e2a1 100644 --- a/ZuneModCore/ModManager.cs +++ b/ZuneModCore/ModManager.cs @@ -75,18 +75,21 @@ namespace ZuneModCore private static StatusModel GetOrCreateStatusModel() { StatusModel? model = null; - if (File.Exists(CoreStatusFile)) + + try { string json = File.ReadAllText(CoreStatusFile); if (!string.IsNullOrWhiteSpace(json)) model = JsonSerializer.Deserialize(json); } - - model ??= new() + catch { - Version = CurrentVersion, - InstalledMods = new() - }; + model = new() + { + Version = CurrentVersion, + InstalledMods = new() + }; + } Guard.IsNotNull(model, nameof(model)); return model;