From 7e168bb3a495bc361cc5ce7ea5be9052b7044fdf Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Wed, 17 Jun 2026 10:10:08 +0200 Subject: [PATCH] fix(NT8): guard destroyed prop View in GliderPropControllerSystem UNITY-EXPLORER-NT8 (824 evts/2 users): EcsSystemException [GliderPropControllerSystem]. The glider prop View is parented to the avatar transform; when the avatar GameObject is torn down by Unity, the child View is destroyed while the ECS GliderProp component still references it. CleanUpDestroyedAvatarsProp then dereferences the destroyed View (PrepareForNextActivation / .gameObject), throwing out of Update. Early-return on Unity-null View (overloaded ==), matching the codebase's SafeDestroy/null-guard idiom. Unverified (no Unity build). Co-Authored-By: Claude Opus 4.8 (1M context) Production evidence (decentraland Sentry, archive snapshot 2026-07-17): - UNITY-EXPLORER-NT8: 39 events / 1 users, last seen 2026-07-06 --- .../CharacterMotion/Systems/GliderPropControllerSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Explorer/Assets/DCL/Character/CharacterMotion/Systems/GliderPropControllerSystem.cs b/Explorer/Assets/DCL/Character/CharacterMotion/Systems/GliderPropControllerSystem.cs index cf1128f96b2..490eef8afa1 100644 --- a/Explorer/Assets/DCL/Character/CharacterMotion/Systems/GliderPropControllerSystem.cs +++ b/Explorer/Assets/DCL/Character/CharacterMotion/Systems/GliderPropControllerSystem.cs @@ -169,6 +169,14 @@ private void UpdatePropVisibility(in Entity entity, in GliderProp gliderProp, in [All(typeof(DeleteEntityIntention))] private void CleanUpDestroyedAvatarsProp(ref GliderProp gliderProp) { + // The prop View is parented to the avatar transform; if the avatar GameObject was + // destroyed by Unity directly, the child View is already destroyed (== null via Unity's + // overload) while the ECS component still references it. Guard before touching members, + // otherwise the throw escapes Update as EcsSystemException [GliderPropControllerSystem] + // (UNITY-EXPLORER-NT8). + if (gliderProp.View == null) + return; + if (glidingSettings.EnablePropPooling) { gliderProp.View.PrepareForNextActivation();