From a9b743f92e79c1832f46649941c46718220620d6 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Mon, 5 Jul 2021 18:03:30 +0900 Subject: [PATCH] fix MissingReferenceException --- Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); + } } } }