Skip to content

Renderers: Make info log evaluation more robust.#31438

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev3
Jul 17, 2025
Merged

Renderers: Make info log evaluation more robust.#31438
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev3

Conversation

@Mugen87

@Mugen87 Mugen87 commented Jul 17, 2025

Copy link
Copy Markdown
Collaborator

Fixed #31436.

Description

Previously (see #30400), I have assumed the return value of getProgramInfoLog() and getShaderInfoLog() must always be a string. The MDN documents the return values like that.

But when looking at the WebGL spec, the return value is defined as DOMString?. So it can be null. The PR makes sure to make the call of getShaderInfoLog() and getProgramInfoLog() more safe by testing for null/undefined and use an empty string in that case. Subsequent code can then work as usual.

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.01
78.83
338.04
78.86
+30 B
+27 B
WebGPU 557.92
154.36
557.93
154.37
+12 B
+6 B
WebGPU Nodes 556.84
154.16
556.85
154.17
+12 B
+6 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 469.26
113.53
469.29
113.56
+30 B
+26 B
WebGPU 633.22
171.39
633.23
171.4
+12 B
+5 B
WebGPU Nodes 588.35
160.71
588.37
160.71
+12 B
+4 B

@Mugen87 Mugen87 added this to the r179 milestone Jul 17, 2025
@Mugen87 Mugen87 merged commit b62351b into mrdoob:dev Jul 17, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError Cannot read properties of null (reading 'trim')

1 participant