Skip to content

Commit 75d962a

Browse files
ddscharfeghentschke
authored andcommitted
Guard if no editor is associated with the hover. This happens when the
debug hover is used from a non cdt-editor, e.g. the cdt-lsp editor.
1 parent e00e7b0 commit 75d962a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/editors/AbstractDebugTextHover.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ protected String getExpressionText(ITextViewer textViewer, final IRegion hoverRe
239239
* validated
240240
*/
241241
private String getExpressionTextFromAST(IDocument document, final IRegion hoverRegion) {
242-
ICElement cElement = CDTUITools.getEditorInputCElement(getEditor().getEditorInput());
242+
ICElement cElement = getEditor() == null ? null
243+
: CDTUITools.getEditorInputCElement(getEditor().getEditorInput());
244+
243245
if (!(cElement instanceof ITranslationUnit)) {
244246
return null;
245247
}

0 commit comments

Comments
 (0)