Просмотр исходного кода

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

Pavel Mazhuga 10 месяцев назад
Родитель
Сommit
8146d0a8ba
1 измененных файлов с 1 добавлено и 1 удалено
  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号