Skip to content

Commit 2f327d1

Browse files
committed
add null check for component before copying to it
1 parent 10d680a commit 2f327d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Assets/FbxExporters/Editor/FbxPrefabAutoUpdater.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,10 @@ public HashSet<GameObject> ImplementUpdates(FbxPrefab prefabInstance)
989989
prefabComponent = prefabXfo.gameObject.AddComponent(fbxComponent.t);
990990
Log("created component {0}:{1}", nodeName, fbxComponent.t);
991991
}
992-
992+
// check that the component exists before copying to it
993+
if (!prefabComponent) {
994+
continue;
995+
}
993996
// Now set the values.
994997
UnityEditor.EditorJsonUtility.FromJsonOverwrite(fbxComponent.jsonValue, prefabComponent);
995998
}

0 commit comments

Comments
 (0)