Просмотр исходного кода

Safely check for XRWebGLBinding (#30319)

ZonkyPop 1 год назад
Родитель
Сommit
2cf6a5bfd3
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/renderers/webxr/WebXRManager.js

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

@@ -277,7 +277,7 @@ class WebXRManager extends EventDispatcher {
 
 
 				// Check that the browser implements the necessary APIs to use an
 				// Check that the browser implements the necessary APIs to use an
 				// XRProjectionLayer rather than an XRWebGLLayer
 				// XRProjectionLayer rather than an XRWebGLLayer
-				const useLayers = XRWebGLBinding !== undefined && 'createProjectionLayer' in XRWebGLBinding.prototype;
+				const useLayers = typeof XRWebGLBinding !== 'undefined' && 'createProjectionLayer' in XRWebGLBinding.prototype;
 
 
 				if ( ! useLayers ) {
 				if ( ! useLayers ) {
 
 

粤ICP备19079148号