Skip to content

Commit f845f5b

Browse files
committed
check if object null after casting to GameObject
1 parent a0fda6e commit f845f5b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ private static List<GameObject> OnConvertInPlace ()
9999

100100
if (unityMainAsset != null) {
101101
Object unityObj = PrefabUtility.InstantiateAttachedAsset (unityMainAsset);
102-
103-
if (unityObj != null)
102+
GameObject unityGO = unityObj as GameObject;
103+
if (unityGO != null)
104104
{
105-
GameObject unityGO = unityObj as GameObject;
106-
107105
SetupImportedGameObject (gosToExport [i], unityGO);
108106

109107
result.Add (unityGO);

0 commit comments

Comments
 (0)