[PR #8879] fix(tui): prevent crash in theme dialog when filter yields no results #12897

Closed
opened 2026-02-16 18:17:47 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8879

State: closed
Merged: No


What does this PR do?

Fixes #8873

Add guard clause in onMove callback to check if option exists before accessing its properties.

AI disclosure: I used opencode with Claude to figure out what was causing the error in the release (1.1.23, latest as of writing) of opencode I was running. I barely have any JS/TS knowledge, and it guided me to this solution.

If this is not the correct approach to solving this bug, and the maintainers would like to change things elsewhere to prevent this, please let me know and I am more than happy to learn and incorporate their feedback.

How did you verify your code works?

  • ./packages/opencode/script/build.ts --single to build "localcode" with the change I made.
  • ./packages/opencode/dist/opencode-darwin-arm64/bin/opencode to start opencode.
  • Opened the theme selector.
  • Searched for sonokai.
  • I did not observe the error being printed in the console, as it is in 1.1.23 when I typed n.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8879 **State:** closed **Merged:** No --- ### What does this PR do? Fixes #8873 Add guard clause in `onMove` callback to check if option exists before accessing its properties. AI disclosure: I used opencode with Claude to figure out what was causing the error in the release (1.1.23, latest as of writing) of opencode I was running. I barely have any JS/TS knowledge, and it guided me to this solution. If this is not the correct approach to solving this bug, and the maintainers would like to change things elsewhere to prevent this, please let me know and I am more than happy to learn and incorporate their feedback. ### How did you verify your code works? - `./packages/opencode/script/build.ts --single` to build "localcode" with the change I made. - `./packages/opencode/dist/opencode-darwin-arm64/bin/opencode` to start opencode. - Opened the theme selector. - Searched for `sonokai`. - I did not observe the error being printed in the console, as it is in `1.1.23` when I typed `n`.
yindo added the pull-request label 2026-02-16 18:17:47 -05:00
yindo closed this issue 2026-02-16 18:17:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12897