Ver Fonte

Set animation context only if window is available

Harold Iedema há 7 anos atrás
pai
commit
edd804017a
1 ficheiros alterados com 2 adições e 1 exclusões
  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( typeof window !== 'undefined' ? window : null );
+
+	if ( typeof window !== 'undefined' ) animation.setContext( window );
 
 	this.setAnimationLoop = function ( callback ) {