Explorar o código

WebVRManager: Add missing window check. See #12461

Mr.doob %!s(int64=8) %!d(string=hai) anos
pai
achega
99dab100b7
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/renderers/webvr/WebVRManager.js

+ 5 - 1
src/renderers/webvr/WebVRManager.js

@@ -215,7 +215,11 @@ function WebVRManager( renderer ) {
 
 	this.dispose = function () {
 
-		window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange );
+		if ( typeof window !== 'undefined' ) {
+
+			window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange );
+
+		}
 
 	};