Skip to content

Commit 9b1c279

Browse files
authored
Fix JS runtime exception on WebGL getContextAttributes (#25618) (#25619)
This is a blind fix for #25618
1 parent 312f9ad commit 9b1c279

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib/libhtml5_webgl.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,8 @@ var LibraryHtml5WebGL = {
306306
if (!a) return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_PARAM }}};
307307
c = GL.contexts[c];
308308
if (!c) return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_TARGET }}};
309-
var t = c.GLctx;
309+
var t = c.GLctx?.getContextAttributes();
310310
if (!t) return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_TARGET }}};
311-
t = t.getContextAttributes();
312311

313312
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.alpha, 't.alpha', 'i8') }}};
314313
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.depth, 't.depth', 'i8') }}};

0 commit comments

Comments
 (0)