Browse Source

GLTFExporter: Check for document before creating OffscreenCanvas

Robert Long 3 years ago
parent
commit
5942bd4c82
1 changed files with 1 additions and 1 deletions
  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 );
 		cachedCanvas = new OffscreenCanvas( 1, 1 );