Skip to content

Commit e2b1eb8

Browse files
committed
ignore missing components on update
1 parent cd0309f commit e2b1eb8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Assets/FbxExporters/Editor/FbxPrefabAutoUpdater.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ public FbxRepresentation(Transform xfo, bool isRoot = true)
306306
m_children.Add(child.name, new FbxRepresentation(child, isRoot: false));
307307
}
308308
foreach(var component in xfo.GetComponents<Component>()) {
309+
// ignore missing components
310+
if (component == null) { continue; }
311+
309312
// Don't save the prefab link, to avoid a logic loop.
310313
if (component is FbxPrefab) { continue; }
311314

@@ -759,6 +762,10 @@ void ClassifyComponents(Transform newFbx, Transform prefab)
759762
componentTypes[componentType.ToString()] = componentType;
760763
}
761764
foreach(var component in prefab.GetComponentsInChildren<Component>()) {
765+
// ignore missing components
766+
if (component == null) {
767+
continue;
768+
}
762769
var componentType = component.GetType();
763770
componentTypes[componentType.ToString()] = componentType;
764771
}

0 commit comments

Comments
 (0)