From 6cb249be44151a4af4c57be22d89f42891c4c6db Mon Sep 17 00:00:00 2001 From: nekobako Date: Sat, 31 Aug 2024 10:05:07 +0900 Subject: [PATCH] fix: error when deleting Material Setter target (#1066) --- Editor/ReactiveObjects/MaterialSetterPreview.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Editor/ReactiveObjects/MaterialSetterPreview.cs b/Editor/ReactiveObjects/MaterialSetterPreview.cs index 0889bfa8..29f0b07d 100644 --- a/Editor/ReactiveObjects/MaterialSetterPreview.cs +++ b/Editor/ReactiveObjects/MaterialSetterPreview.cs @@ -33,6 +33,11 @@ namespace nadena.dev.modular_avatar.core.editor private static ImmutableList<(int, Material)> GetMaterialOverridesForRenderer(ComputeContext ctx, Renderer r) { + if (r == null) + { + return ImmutableList<(int, Material)>.Empty; + } + var avatar = ctx.GetAvatarRoot(r.gameObject); var analysis = ReactiveObjectAnalyzer.CachedAnalyze(ctx, avatar);