1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

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.
This commit is contained in:
Dominic Scharfe 2023-05-15 16:00:48 +02:00 committed by Gesa Hentschke
parent e00e7b0d0d
commit 75d962a691

View file

@ -239,7 +239,9 @@ public abstract class AbstractDebugTextHover implements ICEditorTextHover, IText
* 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;
}