You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NullPointerException at SingleHostConnectionFunction#getCredentials when configuration password is null #622
The PostgresqlConnectionConfiguration.Builder allows to build a configuration where the password field is null (instead of an empty publisher), it blows up when SingleHostConnectionFunction#getCredentials is called as it tries to create a Mono with null value.
Stack trace
Caused by: java.lang.NullPointerException: publisher
at java.base/java.util.Objects.requireNonNull(Objects.java:259)
at reactor.core.publisher.MonoFromPublisher.<init>(MonoFromPublisher.java:44)
at reactor.core.publisher.Mono.wrap(Mono.java:5383)
at reactor.core.publisher.Mono.from(Mono.java:507)
at io.r2dbc.postgresql.SingleHostConnectionFunction.getCredentials(SingleHostConnectionFunction.java:72)
at io.r2dbc.postgresql.SingleHostConnectionFunction.lambda$connect$2(SingleHostConnectionFunction.java:48)
at reactor.core.publisher.MonoDelayUntil$DelayUntilCoordinator.subscribeNextTrigger(MonoDelayUntil.java:293)
... 29 common frames omitted
Expected behavior/code
To not fail if a password is not set to the builder given that the field used to be nullable and the change from #613 changed the behaviour making it not compatible with existing code from SpringBoot.
Possible Solution
The builder could assign a default value (Mono.empty()) to the password field
changed the title [-]NullPointerException at SingleHostConnectionFunction#getCredentials when configuration password is null (regression from #613)[/-][+]`NullPointerException` at `SingleHostConnectionFunction#getCredentials` when configuration password is `null`[/+]on Dec 28, 2023
Activity
[-]NullPointerException at SingleHostConnectionFunction#getCredentials when configuration password is null (regression from #613)[/-][+]`NullPointerException` at `SingleHostConnectionFunction#getCredentials` when configuration password is `null`[/+]Return non-null password publisher if no password is provided.
Return non-null password publisher if no password is provided.