Skip to content

Commit 2dec960

Browse files
authored
fix: null pointer issue for user that belongs to no tenant (#135)
1 parent e41f9f6 commit 2dec960

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [4.0.2]
11+
12+
- Fixes null pointer issue when user belongs to no tenant.
13+
14+
1015
## [4.0.1] - 2023-07-11
1116

1217
- Fixes duplicate users in users search queries when user is associated to multiple tenants

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "4.0.1"
5+
version = "4.0.2"
66

77
repositories {
88
mavenCentral()

src/main/java/io/supertokens/storage/postgresql/queries/GeneralQueries.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,13 +1060,14 @@ public static Map<String, List<String>> getTenantIdsForUserIds_transaction(Start
10601060
}
10611061
}, result -> {
10621062
Map<String, List<String>> finalResult = new HashMap<>();
1063+
for (String userId : userIds) {
1064+
finalResult.put(userId, new ArrayList<>());
1065+
}
1066+
10631067
while (result.next()) {
10641068
String userId = result.getString("user_id").trim();
10651069
String tenantId = result.getString("tenant_id");
10661070

1067-
if (!finalResult.containsKey(userId)) {
1068-
finalResult.put(userId, new ArrayList<>());
1069-
}
10701071
finalResult.get(userId).add(tenantId);
10711072
}
10721073
return finalResult;

0 commit comments

Comments
 (0)