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:
parent
e00e7b0d0d
commit
75d962a691
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue