fix: NPE when a Spring Boot config source resolves to an empty YAML object#1859
Merged
Merged
Conversation
…bject
Previously, Camel could start successfully when a loaded YAML file's root
object was empty (`{}`). With Spring Boot's recent changes
(spring-projects/spring-boot#48958), when the root
object is empty (`{}`), the resulting `EnumerablePropertySource` now contains
a `null -> ""` mapping (previously this property source was empty). Because
of this, every call to `eps.getPropertyNames()` must now guard against a
null name.
Confirmed this is a regression: without this fix, the new test throws an NPE
against the current Spring Boot version. The same test passes against Camel
4.20 (pre-upgrade), which used an older Spring Boot version where this
property source was empty rather than containing a null key.
davsclaus
approved these changes
Jul 20, 2026
Contributor
|
Thanks for the PR |
Contributor
Author
|
thanks for the quick merge 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, Camel could start successfully when a loaded YAML file's root object was empty (
{}). With Spring Boot's recent changes (spring-projects/spring-boot#48958), when the root object is empty ({}), the resultingEnumerablePropertySourcenow contains anull -> ""mapping (previously this property source was empty). Because of this, every call toeps.getPropertyNames()must now guard against a null name.Confirmed this is a regression: without this fix, the new test throws an NPE against the current Spring Boot version. The same test passes against Camel 4.20 (pre-upgrade), which used an older Spring Boot version where this property source was empty rather than containing a null key.