Fixed a bug when trying to deserialize a null type with FromJson.

This commit is contained in:
Makihiro 2024-02-16 21:58:38 +09:00
parent e5a5157b3c
commit f781ad7373

View File

@ -12,7 +12,7 @@ namespace MackySoft.SerializeReferenceExtensions.Editor {
#if UNITY_2021_3_OR_NEWER
// NOTE: managedReferenceValue getter is available only in Unity 2021.3 or later.
if (property.managedReferenceValue != null)
if (property.managedReferenceValue != null && type != null)
{
// Restore an previous values from json.
string json = JsonUtility.ToJson(property.managedReferenceValue);