提交 d62ba3d1 编写于 作者: J Jason Song 提交者: GitHub

Merge pull request #735 from nobodyiam/fix-conditional-npe

fix potential conditional npe
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册