Skip to content

Commit

Permalink
Guard if no editor is associated with the hover. This happens when the
Browse files Browse the repository at this point in the history
debug hover is used from a non cdt-editor, e.g. the cdt-lsp editor.
  • Loading branch information
ddscharfe authored and ghentschke committed May 16, 2023
1 parent e00e7b0 commit 75d962a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ protected String getExpressionText(ITextViewer textViewer, final IRegion hoverRe
* validated
*/
private String getExpressionTextFromAST(IDocument document, final IRegion hoverRegion) {
ICElement cElement = CDTUITools.getEditorInputCElement(getEditor().getEditorInput());
ICElement cElement = getEditor() == null ? null
: CDTUITools.getEditorInputCElement(getEditor().getEditorInput());

if (!(cElement instanceof ITranslationUnit)) {
return null;
}
Expand Down

0 comments on commit 75d962a

Please sign in to comment.