Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
fix: Avoid js error when user is logging out
Browse files Browse the repository at this point in the history
  • Loading branch information
aelamrani committed Jun 7, 2018
1 parent 4bab916 commit 2773046
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ class UserService {
}

currentUserPicture(): string {
return `${this.userURL}avatar?${this.StringService.hashCode(this.currentUser.username)}`;
if (this.currentUser) {
return `${this.userURL}avatar?${this.StringService.hashCode(this.currentUser.username)}`;
}
}

getUserAvatar(id: string): string {
Expand Down

0 comments on commit 2773046

Please sign in to comment.