Skip to content

Commit 785239f

Browse files
committed
check if user count is null for subExists()
Signed-off-by: Etienne Homer <[email protected]>
1 parent f9fcdbb commit 785239f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/gridsuite/useradmin/server/service/UserAdminService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void delete(UUID id, String userId) {
5656
}
5757

5858
public boolean subExists(String sub) {
59-
return applicationProps.getAdmins().isEmpty() || !repository.findAllBySub(sub).isEmpty();
59+
return (applicationProps.getAdmins().isEmpty() && repository.count() == 0) || !repository.findAllBySub(sub).isEmpty();
6060
}
6161

6262
private boolean isAdmin(String sub) {

0 commit comments

Comments
 (0)