mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-22 07:29:17 +01:00
fix config load issues
This commit is contained in:
parent
a206d7c0cc
commit
48b28c7fe9
2 changed files with 10 additions and 2 deletions
|
|
@ -51,8 +51,16 @@ public abstract class ConfigurationServiceBase<T> : IDisposable where T : IMareC
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
config = JsonSerializer.Deserialize<T>(File.ReadAllText(ConfigurationPath));
|
config = JsonSerializer.Deserialize<T>(File.ReadAllText(ConfigurationPath));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// config failed to load for some reason
|
||||||
|
config = default;
|
||||||
|
}
|
||||||
if (config == null)
|
if (config == null)
|
||||||
{
|
{
|
||||||
config = (T)Activator.CreateInstance(typeof(T))!;
|
config = (T)Activator.CreateInstance(typeof(T))!;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors></Authors>
|
<Authors></Authors>
|
||||||
<Company></Company>
|
<Company></Company>
|
||||||
<Version>0.8.2</Version>
|
<Version>0.8.3</Version>
|
||||||
<Description></Description>
|
<Description></Description>
|
||||||
<Copyright></Copyright>
|
<Copyright></Copyright>
|
||||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue