Browse Source

Fixes error when controllers are disconnected on XR exit when not being connected to a hand before. (#26387)

hybridherbst 2 years ago
parent
commit
e41d3feea2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/jsm/webxr/OculusHandPointerModel.js

+ 2 - 2
examples/jsm/webxr/OculusHandPointerModel.js

@@ -70,8 +70,8 @@ class OculusHandPointerModel extends THREE.Object3D {
 		this.visible = false;
 		this.xrInputSource = null;
 
-		this.pointerGeometry.dispose();
-		this.pointerMesh.material.dispose();
+		if (this.pointerGeometry) this.pointerGeometry.dispose();
+		if (this.pointerMesh && this.pointerMesh.material) this.pointerMesh.material.dispose();
 
 		this.clear();