From 6784b6ca1e654f7fb8e5f3dfadc461f36ce6bc2c Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Tue, 2 Jun 2020 00:23:50 -0400 Subject: [PATCH] Checks for user --- src/app/navbar/navbar.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index 4ad7cff..288ba4c 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -39,7 +39,11 @@ export class NavbarComponent { if (isSignedIn()) { this.api.getUser().subscribe(u => { this.user = u; - this.googleAnalyticsService.setUser(this.user.uid); + + if (this.user && this.user.uid) { + this.googleAnalyticsService.setUser(this.user.uid); + } + this._loadNavLinks(); }, error => { localStorage.removeItem('token');