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) {