Explorar o código

GLTFExporter: Check for document before creating OffscreenCanvas

Robert Long %!s(int64=3) %!d(string=hai) anos
pai
achega
5942bd4c82
Modificáronse 1 ficheiros con 1 adicións e 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 );