Skip to content

Commit 8b25094

Browse files
committed
fix that the user can maybe null
1 parent f053141 commit 8b25094

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Phonebook.Frontend/src/app/pages/dashboard/components/team/team.component.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ export class TeamComponent implements OnInit, OnDestroy {
2929
if (this.currentUser != null) {
3030
this.organigramService.getOrganigramTree()
3131
.subscribe(organigram => {
32-
let orgUnitOfUser = this.organigramService.getNodeForUser(this.currentUser, organigram, 0)
33-
if (orgUnitOfUser != null) {
34-
this.teamPersons = [
35-
...orgUnitOfUser.supervisors,
36-
...orgUnitOfUser.assistents,
37-
...orgUnitOfUser.employees,
38-
...orgUnitOfUser.learners,
39-
];
32+
if (this.currentUser != null) {
33+
let orgUnitOfUser = this.organigramService.getNodeForUser(this.currentUser, organigram, 0)
34+
if (orgUnitOfUser != null) {
35+
this.teamPersons = [
36+
...orgUnitOfUser.supervisors,
37+
...orgUnitOfUser.assistents,
38+
...orgUnitOfUser.employees,
39+
...orgUnitOfUser.learners,
40+
];
41+
}
4042
}
4143
});
4244
}

0 commit comments

Comments
 (0)