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 NPE if ITextViewer is nullified during call to .underline() #914

Conversation

joaodinissf
Copy link
Contributor

Previously, it was possible for the viewer variable used in LSPDocumentLinkPresentationReconcilingStrategy.underline() to be nullified externally, which caused a null-pointer exception for the call viewer.getTextWidget().

This commit solves this problem by saving the relevant viewer as a variable local to the
LSPDocumentLinkPresentationReconcilingStrategy.underline() function.

Copy link
Contributor

@rubenporras rubenporras left a comment

Choose a reason for hiding this comment

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

thanks

Previously, it was possible for the `viewer` variable used in
`LSPDocumentLinkPresentationReconcilingStrategy.underline()` to be
nullified externally, which caused a null-pointer exception for the
call `viewer.getTextWidget()`.

This commit solves this problem by saving the relevant viewer as a
variable local to the
`LSPDocumentLinkPresentationReconcilingStrategy.underline()` function.
@akurtakov akurtakov force-pushed the protect-against-external-nullification-of-viewer-variable branch from 6f83639 to 2ebbfea Compare February 14, 2024 07:13
@mickaelistria mickaelistria merged commit 0242893 into eclipse:master Feb 14, 2024
2 checks passed
@joaodinissf joaodinissf deleted the protect-against-external-nullification-of-viewer-variable branch February 14, 2024 08:32
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

3 participants