Skip to content

Commit

Permalink
fix: null pointer issue for user that belongs to no tenant (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc authored Jul 17, 2023
1 parent e41f9f6 commit 2dec960
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [4.0.2]

- Fixes null pointer issue when user belongs to no tenant.


## [4.0.1] - 2023-07-11

- Fixes duplicate users in users search queries when user is associated to multiple tenants
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
}

version = "4.0.1"
version = "4.0.2"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,13 +1060,14 @@ public static Map<String, List<String>> getTenantIdsForUserIds_transaction(Start
}
}, result -> {
Map<String, List<String>> finalResult = new HashMap<>();
for (String userId : userIds) {
finalResult.put(userId, new ArrayList<>());
}

while (result.next()) {
String userId = result.getString("user_id").trim();
String tenantId = result.getString("tenant_id");

if (!finalResult.containsKey(userId)) {
finalResult.put(userId, new ArrayList<>());
}
finalResult.get(userId).add(tenantId);
}
return finalResult;
Expand Down

0 comments on commit 2dec960

Please sign in to comment.