Skip to content

Conversation

@renormalize
Copy link

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.

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

Signed-off-by: Saketh Kalaga <[email protected]>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Copy link
Contributor

@roerohan roerohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GG

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.

bug: theme selector crashes when filtering produces no results

2 participants