From 15d4764185a5eba8cbb0f735a643d8879557c851 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 3 Apr 2019 22:59:22 +0200 Subject: [PATCH] Avoid bindable properties check when target has null value See gh-16447 --- .../boot/context/properties/bind/JavaBeanBinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java index 90e55d4acb..689a00ba29 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java @@ -45,7 +45,7 @@ class JavaBeanBinder implements DataObjectBinder { @Override public T bind(ConfigurationPropertyName name, Bindable target, Context context, DataObjectPropertyBinder propertyBinder) { - boolean hasKnownBindableProperties = hasKnownBindableProperties(name, context); + boolean hasKnownBindableProperties = target.getValue() != null && hasKnownBindableProperties(name, context); Bean bean = Bean.get(target, hasKnownBindableProperties); if (bean == null) { return null;