1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

null checks

This commit is contained in:
Kyle Spearrin
2020-05-22 14:28:20 -04:00
parent 059ff0647a
commit f0f7f89ea8
2 changed files with 5 additions and 2 deletions

2
jslib

Submodule jslib updated: 0092aac275...2858724f44

View File

@@ -104,11 +104,14 @@ export class SyncService {
}
private filterUnsupportedUsers(users: UserEntry[]): UserEntry[] {
return users.filter((u) => u.email == null || u.email.length <= 50);
return users == null ? null : users.filter((u) => u.email == null || u.email.length <= 50);
}
private flattenUsersToGroups(levelGroups: GroupEntry[], allGroups: GroupEntry[]): Set<string> {
let allUsers = new Set<string>();
if (allGroups == null) {
return allUsers;
}
for (const group of levelGroups) {
const childGroups = allGroups.filter((g) => group.groupMemberReferenceIds.has(g.referenceId));
const childUsers = this.flattenUsersToGroups(childGroups, allGroups);