From e35bfd42926150140be1a6dae14fc698b07b818d Mon Sep 17 00:00:00 2001 From: Kulltero <33698270+Kulltero@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:57:06 +0200 Subject: [PATCH 1/2] fix NRE during fade when element is destroyed --- CommunityEntity.UI.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CommunityEntity.UI.cs b/CommunityEntity.UI.cs index b052f81..a787bb4 100644 --- a/CommunityEntity.UI.cs +++ b/CommunityEntity.UI.cs @@ -1020,6 +1020,9 @@ private void BuildScrollbar(Scrollbar scrollbar, JSON.Object obj, bool vertical) static IEnumerator FadeCanvasGroup(CanvasGroup group, float to, float duration) { + if(group == null) + yield break; + float from = group.alpha; float elapsed = 0f; while (elapsed < duration) @@ -1032,8 +1035,10 @@ static IEnumerator FadeCanvasGroup(CanvasGroup group, float to, float duration) if (group.alpha != value) yield break; } - group.alpha = to; - } + + if(group != null) + group.alpha = to; + } // sets the transform to a sensible default private void FitParent(RectTransform transform){ From 5f73fbcb1fca926c1272d02de333a09a27a76db7 Mon Sep 17 00:00:00 2001 From: Kulltero <33698270+Kulltero@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:58:15 +0200 Subject: [PATCH 2/2] check here too --- CommunityEntity.UI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityEntity.UI.cs b/CommunityEntity.UI.cs index a787bb4..85fe9d0 100644 --- a/CommunityEntity.UI.cs +++ b/CommunityEntity.UI.cs @@ -1032,7 +1032,7 @@ static IEnumerator FadeCanvasGroup(CanvasGroup group, float to, float duration) group.alpha = value; yield return null; // another fade changed the value since we set it, abort - if (group.alpha != value) + if (group == null || group.alpha != value) yield break; }