Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2016-10-20 11:34:48 +0000
committerAndrey Loskutov2016-10-20 11:38:47 +0000
commit869e6e8f1c7d9b0be6ca0d8f3bd22573913848b0 (patch)
treeb8052b0c05fb123aeb876919a739959bde9a702f /org.eclipse.ui.editors
parent9e81f5ff60dca59cfd31ba8a1cef5df509411024 (diff)
downloadeclipse.platform.text-869e6e8f1c7d9b0be6ca0d8f3bd22573913848b0.tar.gz
eclipse.platform.text-869e6e8f1c7d9b0be6ca0d8f3bd22573913848b0.tar.xz
eclipse.platform.text-869e6e8f1c7d9b0be6ca0d8f3bd22573913848b0.zip
Bug 505940 - NPE on overview ruler on editor for IFileRevision on plainY20161020-1800
text file Fixed regression in org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.findSelectedOverviewRulerAnnotationLabel(), introduced via commit b6ac8fd637f7fa7343820fdff40b9b2cfd6bc54b. Updated javadoc of ISourceViewer to make clear that null return is possible. Change-Id: I0fa6b83a79499b9b2b59edc2527166e8e1fa80b1 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.ui.editors')
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
index 04dfd8f97..ca16934ef 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
@@ -1788,8 +1788,11 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor {
}
private String findSelectedOverviewRulerAnnotationLabel() {
- Point selection= getSourceViewer().getSelectedRange();
IAnnotationModel model= getSourceViewer().getAnnotationModel();
+ if (model == null) {
+ return null;
+ }
+ Point selection= getSourceViewer().getSelectedRange();
Annotation annotation= null;
Iterator<Annotation> iter= model.getAnnotationIterator();
while (iter.hasNext()) {

Back to the top