diff --git a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs index 248700a39..89c6560aa 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs @@ -66,7 +66,10 @@ namespace UniGLTF public void Dispose() { - UnityObjectDestoyer.DestroyRuntimeOrEditor(this.gameObject); + if (this != null && this.gameObject != null) + { + UnityObjectDestoyer.DestroyRuntimeOrEditor(this.gameObject); + } } } }