and it wasn't possible for me to see that before?

This commit is contained in:
Pilzinsel64
2025-07-10 06:34:43 +02:00
parent c012e33ef4
commit b9c6054185
2 changed files with 2 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<PropertyGroup>
<Version>3.2.3</Version>
<Version>3.2.4</Version>
</PropertyGroup>
<ItemGroup>

View File

@@ -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)