Skip to content

Commit

Permalink
fix NPE in IdentityServicesPropertySourceFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
finkmanAtSap committed May 14, 2024
1 parent 2b6c678 commit 6a4d1a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to this project will be documented in this file.

## 2.17.6
- [spring-security] fixed NPE in IdentityServicesPropertySourceFactory on application startup when bound to a list of XSUAA services whose service plans are ALL not supported

## 2.17.5
#### Dependency upgrades
- bump spring-core version to 5.3.34
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,19 @@ private void mapXsuaaAttributesSingleInstance(final OAuth2ServiceConfiguration o

private void mapXsuaaProperties(@Nonnull Environment environment) {
final int numberOfXsuaaConfigurations = environment.getNumberOfXsuaaConfigurations();
if (numberOfXsuaaConfigurations == 0) {
final OAuth2ServiceConfiguration xsuaaConfiguration = environment.getXsuaaConfiguration();

if (numberOfXsuaaConfigurations == 0 || xsuaaConfiguration == null) {
/*
* Case "no XSUAA service configurations or only configurations with unsupported plans"
*/
return;
}

/*
* Case "single XSUAA service configuration":
* Then we do not use an array for describing the properties.
* Case "single XSUAA service configuration": Then we do not use an array for
* describing the properties.
*/
final OAuth2ServiceConfiguration xsuaaConfiguration = environment.getXsuaaConfiguration();
if (numberOfXsuaaConfigurations == 1) {
mapXsuaaAttributesSingleInstance(xsuaaConfiguration, XSUAA_PREFIX);
return;
Expand Down

0 comments on commit 6a4d1a8

Please sign in to comment.