From 2cb2e8770e9f7b152ac367df168591dfedaa7385 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Wed, 11 Mar 2020 21:28:16 -0400 Subject: [PATCH] fix exception not properly handled --- .../stream/user-profile/user-profile.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/stream/user-profile/user-profile.component.ts b/src/app/components/stream/user-profile/user-profile.component.ts index 4cbd9f6a..a969ae98 100644 --- a/src/app/components/stream/user-profile/user-profile.component.ts +++ b/src/app/components/stream/user-profile/user-profile.component.ts @@ -106,9 +106,11 @@ export class UserProfileComponent implements OnInit { this.relationShipError = false; this.toolsService.findAccount(userAccount, this.lastAccountName) .then((account: Account) => { + if(!account) throw Error(`Could not find ${this.lastAccountName}`); + return this.getFollowStatus(userAccount, account); }) - .catch((err: HttpErrorResponse) => { + .catch((err) => { console.error(err); this.relationShipError = true; }) @@ -161,6 +163,8 @@ export class UserProfileComponent implements OnInit { this.isLoading = false; this.statusLoading = true; + if(!account) throw Error(`Could not find ${this.lastAccountName}`); + this.displayedAccount = this.fixPleromaFieldsUrl(account); this.hasNote = account && account.note && account.note !== '

'; if (this.hasNote) {