eclipse / lsp4e

Language Server Protocol support in Eclipse IDE
Eclipse Public License 2.0
65 stars 54 forks source link

Fix NPE if ITextViewer is nullified during call to .underline() #914

Closed joaodinissf closed 8 months ago

joaodinissf commented 8 months ago

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.