Skip to content

fix: NPE when a Spring Boot config source resolves to an empty YAML object#1859

Merged
davsclaus merged 1 commit into
apache:mainfrom
vilmosnagy:vilmos/spring-npe-follow-up
Jul 20, 2026
Merged

fix: NPE when a Spring Boot config source resolves to an empty YAML object#1859
davsclaus merged 1 commit into
apache:mainfrom
vilmosnagy:vilmos/spring-npe-follow-up

Conversation

@vilmosnagy

Copy link
Copy Markdown
Contributor

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.

…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
davsclaus merged commit de5c033 into apache:main Jul 20, 2026
5 checks passed
@davsclaus

Copy link
Copy Markdown
Contributor

Thanks for the PR

@vilmosnagy

Copy link
Copy Markdown
Contributor Author

thanks for the quick merge 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants