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 835b0087bc5c..39f589bddb59 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,8 @@ class JavaBeanBinder implements BeanBinder { @Override public T bind(ConfigurationPropertyName name, Bindable target, Context context, BeanPropertyBinder 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;