diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/condition/OnProfileCondition.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/condition/OnProfileCondition.java index 860fd78914b..5b417a191c9 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/condition/OnProfileCondition.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/condition/OnProfileCondition.java @@ -32,10 +32,15 @@ private Set retrieveAnnotatedProfiles(AnnotatedTypeMetadata metadata, St return Collections.emptySet(); } - Set profiles = Sets.newHashSet(); MultiValueMap attributes = metadata.getAllAnnotationAttributes(annotationType); + if (attributes == null) { + return Collections.emptySet(); + } + + Set profiles = Sets.newHashSet(); List values = attributes.get("value"); + if (values != null) { for (Object value : values) { if (value instanceof String[]) {