Browse Source

WebXRManager: add null check in onSessionEnd() (#23984)

* WebXRManager: add null check in onSessionEnd()

This commit adds a null check prior to disconnecting the controller in `onSessionEnd()` as described in https://github.com/mrdoob/three.js/issues/23983

* Fix spacing for Lint
kalegd 3 năm trước cách đây
mục cha
commit
65ffdea606
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/renderers/webxr/WebXRManager.js

+ 5 - 1
src/renderers/webxr/WebXRManager.js

@@ -133,7 +133,11 @@ class WebXRManager extends EventDispatcher {
 
 			inputSourcesMap.forEach( function ( controller, inputSource ) {
 
-				controller.disconnect( inputSource );
+				if ( controller ) {
+
+					controller.disconnect( inputSource );
+
+				}
 
 			} );