Преглед на файлове

Set animation context only if window is available

Harold Iedema преди 7 години
родител
ревизия
edd804017a
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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 ) {