From 37ce7cc25671ac1f531793b4bc7e56ee594846d3 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 16 Jul 2024 14:07:27 -0400 Subject: [PATCH] add check for missing webgl context in WebGLDrawer.isSupported() --- src/webgldrawer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webgldrawer.js b/src/webgldrawer.js index a8167b00..ed1f30ab 100644 --- a/src/webgldrawer.js +++ b/src/webgldrawer.js @@ -195,7 +195,7 @@ let canvasElement = document.createElement( 'canvas' ); let webglContext = $.isFunction( canvasElement.getContext ) && canvasElement.getContext( 'webgl' ); - let ext = webglContext.getExtension('WEBGL_lose_context'); + let ext = webglContext && webglContext.getExtension('WEBGL_lose_context'); if(ext){ ext.loseContext(); }