Commit e1d26167 by Jason Song

fix potential conditional npe

parent c8ef52c4
...@@ -32,10 +32,15 @@ public class OnProfileCondition implements Condition { ...@@ -32,10 +32,15 @@ public class OnProfileCondition implements Condition {
return Collections.emptySet(); return Collections.emptySet();
} }
Set<String> profiles = Sets.newHashSet();
MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(annotationType); MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(annotationType);
if (attributes == null) {
return Collections.emptySet();
}
Set<String> profiles = Sets.newHashSet();
List<?> values = attributes.get("value"); List<?> values = attributes.get("value");
if (values != null) { if (values != null) {
for (Object value : values) { for (Object value : values) {
if (value instanceof String[]) { if (value instanceof String[]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment