Explorar o código

Add additional existence checks for helpers to setTileVisible.

Justin Manley %!s(int64=4) %!d(string=hai) anos
pai
achega
f1ec823c08
Modificáronse 1 ficheiros con 11 adicións e 2 borrados
  1. 11 2
      src/three/DebugTilesRenderer.js

+ 11 - 2
src/three/DebugTilesRenderer.js

@@ -367,8 +367,17 @@ export class DebugTilesRenderer extends TilesRenderer {
 
 		if ( ! visible ) {
 
-			boxGroup.remove( boxHelperGroup );
-			sphereGroup.remove( sphereHelper );
+			if ( boxHelperGroup ) {
+
+				boxGroup.remove( boxHelperGroup );
+
+			}
+
+			if ( sphereHelper ) {
+
+				sphereGroup.remove( sphereHelper );
+
+			}
 
 		} else {