diff --git a/JotunnLib/Utils/SimpleJson.cs b/JotunnLib/Utils/SimpleJson.cs index aaef69ae3..de8042d58 100644 --- a/JotunnLib/Utils/SimpleJson.cs +++ b/JotunnLib/Utils/SimpleJson.cs @@ -1429,7 +1429,10 @@ public virtual object DeserializeObject(object value, Type type) obj = value; else { - obj = ConstructorCache[type](); + var constructorDelegate = ConstructorCache[type]; + if (constructorDelegate != null) obj = constructorDelegate(); + else throw new MissingMethodException($"No default constructor found for {type}"); + foreach (KeyValuePair> setter in SetCache[type]) { object jsonValue;