From 7f8a8ba115d49d10199ce2c75f353f5ce5c34493 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 29 Jun 2017 09:59:50 +0200 Subject: [PATCH] Properly handle `null` package Closes gh-9621 --- .../ConfigurationPropertiesBindingPostProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 2d22769c427..17ccdf9e8a5 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -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()) {