mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Bug 389191 - NPE in CDocHover.getHoverInfo()
Change-Id: Ied3f42206a5af49577bc487b3c40a1b87a02cd02 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
8af3f1df86
commit
95aa27858c
1 changed files with 6 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.cdt.internal.ui.text.c.hover;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.IRegion;
|
||||
import org.eclipse.jface.text.ITextViewer;
|
||||
import org.eclipse.jface.text.Region;
|
||||
|
@ -46,7 +47,11 @@ public class CDocHover extends AbstractCEditorTextHover {
|
|||
if (getEditor() == null)
|
||||
return null;
|
||||
try {
|
||||
expression = viewer.getDocument().get(region.getOffset(), region.getLength());
|
||||
IDocument document = viewer.getDocument();
|
||||
if (document == null) {
|
||||
return null;
|
||||
}
|
||||
expression = document.get(region.getOffset(), region.getLength());
|
||||
expression = expression.trim();
|
||||
if (expression.isEmpty())
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue