Pārlūkot izejas kodu

CSMShadowNode: Fix error when disposed multiple times (#33202)

Shota Matsuda 2 mēneši atpakaļ
vecāks
revīzija
21ae313183
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      examples/jsm/csm/CSMShadowNode.js

+ 6 - 2
examples/jsm/csm/CSMShadowNode.js

@@ -574,8 +574,12 @@ class CSMShadowNode extends ShadowBaseNode {
 			const light = this.lights[ i ];
 			const light = this.lights[ i ];
 			const parent = light.parent;
 			const parent = light.parent;
 
 
-			parent.remove( light.target );
-			parent.remove( light );
+			if ( parent !== null ) {
+
+				parent.remove( light.target );
+				parent.remove( light );
+
+			}
 
 
 		}
 		}
 
 

粤ICP备19079148号