and it wasn't possible for me to see that before?
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>3.2.3</Version>
|
||||
<Version>3.2.4</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -20,12 +20,8 @@ public class Settings : ISettings
|
||||
return settingsExisting;
|
||||
|
||||
// Create new & reset
|
||||
T instance = default;
|
||||
if (Activator.CreateInstance<T>() is T settingsNew)
|
||||
{
|
||||
settingsNew.Reset();
|
||||
instance = settingsNew;
|
||||
}
|
||||
else
|
||||
settingsNew = default;
|
||||
|
||||
@@ -36,7 +32,7 @@ public class Settings : ISettings
|
||||
|
||||
// Populate
|
||||
if (settingsNew != null)
|
||||
serializer.Populate(valueRaw.CreateReader(), instance);
|
||||
serializer.Populate(valueRaw.CreateReader(), settingsNew);
|
||||
|
||||
// Deserialize (fallback)
|
||||
else if (valueRaw.ToObject<T>() is T settingsDeserialized)
|
||||
|
||||
Reference in New Issue
Block a user