From d17f03c45db1ecff2910dc1dc451bfefe3d24507 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Sat, 3 Aug 2024 02:06:51 +0900 Subject: [PATCH] null check --- .../MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs | 2 +- .../URP/Export/Materials/UrpUniUnlitMaterialExporter.cs | 2 +- .../MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs index 2fca9ea28..3ae4807ee 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs @@ -25,7 +25,7 @@ namespace UniGLTF { if (src == null) throw new ArgumentNullException(nameof(src)); if (textureExporter == null) throw new ArgumentNullException(nameof(textureExporter)); - if (src.shader != Shader) throw new UniGLTFShaderNotMatchedInternalException(src.shader); + if (src.shader != Shader || Shader == null) throw new UniGLTFShaderNotMatchedInternalException(src.shader); dst = new glTFMaterial { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs index 8f68209a4..05670b81a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs @@ -24,7 +24,7 @@ namespace UniGLTF { if (src == null) throw new ArgumentNullException(nameof(src)); if (textureExporter == null) throw new ArgumentNullException(nameof(textureExporter)); - if (src.shader != Shader) throw new UniGLTFShaderNotMatchedInternalException(src.shader); + if (src.shader != Shader || Shader == null) throw new UniGLTFShaderNotMatchedInternalException(src.shader); dst = glTF_KHR_materials_unlit.CreateDefault(); dst.name = src.name; diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs index df8523d8c..67659c474 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs @@ -23,7 +23,7 @@ namespace UniGLTF { if (src == null) throw new ArgumentNullException(nameof(src)); if (textureExporter == null) throw new ArgumentNullException(nameof(textureExporter)); - if (src.shader != Shader) throw new UniGLTFShaderNotMatchedInternalException(src.shader); + if (src.shader != Shader || Shader == null) throw new UniGLTFShaderNotMatchedInternalException(src.shader); dst = glTF_KHR_materials_unlit.CreateDefault(); dst.name = src.name;