mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Stop failure to load on broken configuration files.
This commit is contained in:
parent
e98003eb09
commit
e28483d1ae
2 changed files with 15 additions and 7 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit 73f6b14d16920a94b7b98fe85973b9b2b959ada5
|
||||
Subproject commit 7d0fcdbadf70f59675e8666de014e5dcb67da35d
|
||||
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Configuration;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
|
|
@ -124,13 +125,20 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
}
|
||||
|
||||
if (File.Exists(fileNames.ConfigFile))
|
||||
{
|
||||
var text = File.ReadAllText(fileNames.ConfigFile);
|
||||
JsonConvert.PopulateObject(text, this, new JsonSerializerSettings
|
||||
try
|
||||
{
|
||||
Error = HandleDeserializationError,
|
||||
});
|
||||
}
|
||||
var text = File.ReadAllText(fileNames.ConfigFile);
|
||||
JsonConvert.PopulateObject(text, this, new JsonSerializerSettings
|
||||
{
|
||||
Error = HandleDeserializationError,
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Penumbra.ChatService.NotificationMessage(ex,
|
||||
"Error reading Configuration, reverting to default.\nYou may be able to restore your configuration using the rolling backups in the XIVLauncher/backups/Penumbra directory.",
|
||||
"Error reading Configuration", "Error", NotificationType.Error);
|
||||
}
|
||||
|
||||
migrator.Migrate(utility, this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue