Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add null check to inline controller on change #781

Merged
merged 3 commits into from
Aug 22, 2023
Merged

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Aug 22, 2023

fix: add null checks before accessing editor properties

The code to track copy action from inline chat was accessing properties on the editor object without first checking if it was null. This adds null checks before accessing the document and uri properties to avoid potential null reference errors.

This should fix an issue that I run into where VS Code is complaining about Cannot read properties of undefined (reading 'scheme') when I try to start a new chat session:

image

chaterror

Test plan

I'm not sure what the exact steps to reproduce the issue I run into, but try interacting with Cody without using inline chat, then make changes to your text document and then start a new conversation, you should not see the error message about Cannot read properties of undefined (reading 'scheme'):
image

@abeatrix abeatrix requested a review from a team August 22, 2023 01:28
@abeatrix abeatrix merged commit 93d721d into main Aug 22, 2023
8 checks passed
@abeatrix abeatrix deleted the bee/inline-fix branch August 22, 2023 14:53
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.

None yet

2 participants