Explorar el Código

GLTFExporter: Check for document before creating OffscreenCanvas

Robert Long hace 3 años
padre
commit
5942bd4c82
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      examples/jsm/exporters/GLTFExporter.js

+ 1 - 1
examples/jsm/exporters/GLTFExporter.js

@@ -347,7 +347,7 @@ function getCanvas() {
 
 	}
 
-	if ( typeof OffscreenCanvas !== 'undefined' ) {
+	if ( typeof document === 'undefined' && typeof OffscreenCanvas !== 'undefined' ) {
 
 		cachedCanvas = new OffscreenCanvas( 1, 1 );