Skip to content

Commit 71f4d11

Browse files
committed
AnnotationCodeMining should NP check the Annotation.getText() result
Annotation.getText() allows to return null values. Fixes #3556
1 parent 4976c3a commit 71f4d11

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMining.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ public AnnotationCodeMining(IAnnotationAccessExtension annotationAccess, Annotat
4848
super(lineNumber, document, provider, action);
4949
this.annotationAccess= annotationAccess;
5050

51-
setLabel(sanitizeLabel(annotation.getText()));
52-
51+
String text = annotation.getText();
52+
if (text != null) {
53+
setLabel(sanitizeLabel(text));
54+
}
5355
this.annotation= annotation;
5456
}
5557

58+
5659
private static String sanitizeLabel(String label) {
5760
return label.replace('\r', ' ').replace('\n', ' ');
5861
}

0 commit comments

Comments
 (0)