Browse Source

fix: check if OffscreenCanvas in window before accessing (#31194)

Pavel Mazhuga 10 months ago
parent
commit
8146d0a8ba
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

+ 1 - 1
src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

@@ -506,7 +506,7 @@ class WebGLTextureUtils {
 			} else if ( ( typeof HTMLImageElement !== 'undefined' && source instanceof HTMLImageElement ) ||
 				( typeof HTMLCanvasElement !== 'undefined' && source instanceof HTMLCanvasElement ) ||
 				( typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap ) ||
-				source instanceof OffscreenCanvas ) {
+				( typeof OffscreenCanvas !== 'undefined' && source instanceof OffscreenCanvas ) ) {
 
 				return source;
 

粤ICP备19079148号