浏览代码

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

hybridherbst 2 年之前
父节点
当前提交
e41d3feea2
共有 1 个文件被更改,包括 2 次插入2 次删除
  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();