Properly handle null package

Closes gh-9621
This commit is contained in:
Stephane Nicoll
2017-06-29 09:59:50 +02:00
parent 41e6037173
commit 7f8a8ba115

View File

@@ -420,7 +420,8 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
if (AnnotatedElementUtils.hasAnnotation(type, Validated.class)) {
return true;
}
if (type.getPackage().getName().startsWith("org.springframework.boot")) {
if (type.getPackage() != null &&
type.getPackage().getName().startsWith("org.springframework.boot")) {
return false;
}
if (getConstraintsForClass(type).isBeanConstrained()) {