Browse Source

Merge pull request #14249 from haroldiedema/worker-fix

Don't use 'window' if it isn't available
Mr.doob 7 năm trước cách đây
mục cha
commit
8a9a106f79
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/renderers/WebGLRenderer.js

+ 2 - 1
src/renderers/WebGLRenderer.js

@@ -1029,7 +1029,8 @@ function WebGLRenderer( parameters ) {
 
 	var animation = new WebGLAnimation();
 	animation.setAnimationLoop( onAnimationFrame );
-	animation.setContext( window );
+
+	if ( typeof window !== 'undefined' ) animation.setContext( window );
 
 	this.setAnimationLoop = function ( callback ) {