From 2942d78ffd27ee22c7140149f205cae4c2a92f2e Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Mon, 14 Dec 2020 14:17:23 +0100 Subject: [PATCH] fixed profile pic cause by inconsistent backend --- .../components/sidenav-profile/sidenav-profile.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/sidenav-profile/sidenav-profile.component.ts b/src/app/components/sidenav-profile/sidenav-profile.component.ts index db42af7..46dd7c7 100644 --- a/src/app/components/sidenav-profile/sidenav-profile.component.ts +++ b/src/app/components/sidenav-profile/sidenav-profile.component.ts @@ -20,7 +20,8 @@ export class SidenavProfileComponent implements OnInit { if (user !== null){ this.name = user.user.name; this.email = user.user.email; - if (user.user.attributes === null) return; + if (user.user.attributes === null || (Object.keys(user.user.attributes).length === 0 && user.user.attributes.constructor === Object)) return; + console.log("profile url: " + JSON.stringify(user.user.attributes)); this.profileURL = user.user.attributes.profile_url; } });