diff --git a/src/app/components/sidenav-profile/sidenav-profile.component.ts b/src/app/components/sidenav-profile/sidenav-profile.component.ts index d4d6a7f..d1d74cf 100644 --- a/src/app/components/sidenav-profile/sidenav-profile.component.ts +++ b/src/app/components/sidenav-profile/sidenav-profile.component.ts @@ -15,9 +15,12 @@ export class SidenavProfileComponent implements OnInit { ngOnInit() { this.auth.currentUser.subscribe(user => { - this.name = user.user.name; - this.email = user.user.email; - this.profileURL = user.user.attributes.profile_url; + console.log("change " + JSON.stringify(user)); + if (user !== null){ + this.name = user.user.name; + this.email = user.user.email; + this.profileURL = user.user.attributes.profile_url; + } }); } } \ No newline at end of file