Skip to content

Commit 2934eea

Browse files
authored
Merge pull request #52 from mackysoft/fix/nullreference-when-fromjson
Fixed a bug when trying to deserialize a null type with FromJson.
2 parents e5a5157 + f781ad7 commit 2934eea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/ManagedReferenceUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static object SetManagedReference (this SerializedProperty property,Type
1212

1313
#if UNITY_2021_3_OR_NEWER
1414
// NOTE: managedReferenceValue getter is available only in Unity 2021.3 or later.
15-
if (property.managedReferenceValue != null)
15+
if (property.managedReferenceValue != null && type != null)
1616
{
1717
// Restore an previous values from json.
1818
string json = JsonUtility.ToJson(property.managedReferenceValue);

0 commit comments

Comments
 (0)