diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java index d7ae9d81e16a..965b2ed14ab9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java @@ -180,7 +180,7 @@ private static boolean isFullEnumerable(PropertySource source) { } private static PropertySource getRootSource(PropertySource source) { - while (source.getSource() != null && source.getSource() instanceof PropertySource propertySource) { + while (source.getSource() instanceof PropertySource propertySource) { source = propertySource; } return source;