mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
[#959] hasAnnotation: Add null guard
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
This commit is contained in:
parent
e3464552ad
commit
6b522695c1
1 changed files with 3 additions and 0 deletions
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue