Skip to content

Commit 84f875c

Browse files
committed
check if addcomponent failed
1 parent 7994864 commit 84f875c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ public static void CopyComponents(GameObject from, GameObject to){
418418
if (!toComponent) {
419419
// It doesn't exist => create and copy.
420420
toComponent = to.AddComponent(component.GetType());
421-
EditorJsonUtility.FromJsonOverwrite(json, toComponent);
421+
if (toComponent) {
422+
EditorJsonUtility.FromJsonOverwrite (json, toComponent);
423+
}
422424
} else {
423425
// It exists => copy.
424426
// But we want to override that behaviour in a few

0 commit comments

Comments
 (0)