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 ); + + } }