Skip to content

Commit

Permalink
Merge pull request apolloconfig#735 from nobodyiam/fix-conditional-npe
Browse files Browse the repository at this point in the history
fix potential conditional npe
  • Loading branch information
nobodyiam authored Sep 5, 2017
2 parents c8ef52c + e1d2616 commit d62ba3d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ private Set<String> retrieveAnnotatedProfiles(AnnotatedTypeMetadata metadata, St
return Collections.emptySet();
}

Set<String> profiles = Sets.newHashSet();
MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(annotationType);

if (attributes == null) {
return Collections.emptySet();
}

Set<String> profiles = Sets.newHashSet();
List<?> values = attributes.get("value");

if (values != null) {
for (Object value : values) {
if (value instanceof String[]) {
Expand Down

0 comments on commit d62ba3d

Please sign in to comment.