diff --git a/StabilityMatrix.Core/Extensions/JsonObjectExtensions.cs b/StabilityMatrix.Core/Extensions/JsonObjectExtensions.cs index 3fc66521..d9b53dfb 100644 --- a/StabilityMatrix.Core/Extensions/JsonObjectExtensions.cs +++ b/StabilityMatrix.Core/Extensions/JsonObjectExtensions.cs @@ -8,10 +8,10 @@ public static class JsonObjectExtensions /// /// Returns the value of a property with the specified name, or the specified default value if not found. /// - public static T GetPropertyValueOrDefault( + public static T? GetPropertyValueOrDefault( this JsonObject jsonObject, string propertyName, - T defaultValue + T? defaultValue = default ) { if (!jsonObject.TryGetPropertyValue(propertyName, out var node)) @@ -19,6 +19,6 @@ public static class JsonObjectExtensions return defaultValue; } - return node.Deserialize() ?? defaultValue; + return node.Deserialize(); } }