From b8eb311e5df9d221cac89bce9668691972b7f884 Mon Sep 17 00:00:00 2001 From: Shota Matsuda Date: Wed, 18 Mar 2026 17:05:28 +0900 Subject: [PATCH] Check if lights are already removed --- examples/jsm/csm/CSMShadowNode.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/jsm/csm/CSMShadowNode.js b/examples/jsm/csm/CSMShadowNode.js index 57c42e0c0b64b8..4e2ae5b55c228d 100644 --- a/examples/jsm/csm/CSMShadowNode.js +++ b/examples/jsm/csm/CSMShadowNode.js @@ -574,8 +574,12 @@ class CSMShadowNode extends ShadowBaseNode { const light = this.lights[ i ]; const parent = light.parent; - parent.remove( light.target ); - parent.remove( light ); + if ( parent !== null ) { + + parent.remove( light.target ); + parent.remove( light ); + + } }