[#959] hasAnnotation: Add null guard

Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
This commit is contained in:
Karsten Thoms 2018-11-14 04:43:51 +01:00
parent e3464552ad
commit 6b522695c1

View file

@ -1322,6 +1322,9 @@ public class XtextValidator extends AbstractDeclarativeValidator {
* @since 2.14
*/
protected boolean hasAnnotation(AbstractRule rule, String annotationName) {
if (rule == null) {
return false;
}
return rule.getAnnotations().stream().anyMatch(e -> annotationName.equals(e.getName()));
}