Skip to content

fix(desktop): guard null levels and text/reasoning/args in .length calls#3105

Open
jiaxindeyang-a11y wants to merge 1 commit into
esengine:main-v2from
jiaxindeyang-a11y:fix-null-length-crash
Open

fix(desktop): guard null levels and text/reasoning/args in .length calls#3105
jiaxindeyang-a11y wants to merge 1 commit into
esengine:main-v2from
jiaxindeyang-a11y:fix-null-length-crash

Conversation

@jiaxindeyang-a11y
Copy link
Copy Markdown

EffortSwitcher checked effort?.supported but then accessed effort.levels.length without a null guard — a nil []string from Go JSON serialization arrives as null and throws "Cannot read properties of null (reading 'length')".

The same class of bug existed in Transcript's scrollVersion (items may carry null text/reasoning/args from wire events) and in the useEffect dependency array where live?.text.length used single-level optional chaining.

EffortSwitcher checked effort?.supported but then accessed effort.levels.length
without a null guard — a nil []string from Go JSON serialization arrives as null
and throws "Cannot read properties of null (reading 'length')".

The same class of bug existed in Transcript's scrollVersion (items may carry null
text/reasoning/args from wire events) and in the useEffect dependency array where
live?.text.length used single-level optional chaining.
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant