[FIX] NPE в InjectClassAcceptor

This commit is contained in:
Zaxar163 2020-02-01 18:17:16 +01:00
parent 63ea1f59b0
commit d68e1f781e
No known key found for this signature in database
GPG key ID: 1FE4F2E1F053831B

View file

@ -45,9 +45,9 @@ private static void visit(ClassNode classNode, Map<String, Object> values) {
classNode.fields.forEach(field -> { classNode.fields.forEach(field -> {
// Notice that fields that will be used with this algo should not have default // Notice that fields that will be used with this algo should not have default
// value by = ...; // value by = ...;
AnnotationNode valueAnnotation = field.invisibleAnnotations.stream() AnnotationNode valueAnnotation = field.invisibleAnnotations != null ? field.invisibleAnnotations.stream()
.filter(annotation -> INJECTED_FIELD_DESC.equals(annotation.desc)).findFirst() .filter(annotation -> INJECTED_FIELD_DESC.equals(annotation.desc)).findFirst()
.orElse(null); .orElse(null) : null;
if (valueAnnotation == null) { if (valueAnnotation == null) {
return; return;
} }