getHoverInfoInternal: add null guard
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Change-Id: I9e655a976cd336c2151482196347fa1744708f3d
diff --git a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandProblemHover.java b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandProblemHover.java
index 81db538..ff420d1 100644
--- a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandProblemHover.java
+++ b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandProblemHover.java
@@ -30,7 +30,7 @@
public class XtendXpandProblemHover implements IAnnotationHover, ITextHover {
- private ISourceViewer sourceViewer;
+ private final ISourceViewer sourceViewer;
public XtendXpandProblemHover(final ISourceViewer sourceViewer) {
this.sourceViewer = sourceViewer;
@@ -61,6 +61,8 @@
private String getHoverInfoInternal(final int lineNumber, final int offset) {
final IAnnotationModel model = sourceViewer.getAnnotationModel();
+ if (model == null)
+ return "";
final List<String> messages = new ArrayList<String>();
final Iterator<?> iterator = model.getAnnotationIterator();