Explorar el Código

Merge pull request #14249 from haroldiedema/worker-fix

Don't use 'window' if it isn't available
Mr.doob hace 8 años
padre
commit
8a9a106f79
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/renderers/WebGLRenderer.js

+ 2 - 1
src/renderers/WebGLRenderer.js

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

粤ICP备19079148号