From: Dessalines Date: Thu, 18 Nov 2021 15:33:27 +0000 (-0500) Subject: Fixing error for null person_block. Fixes #491 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%7B%7D/%7BcommunityRSSUrl%28?a=commitdiff_plain;h=b27d6e904c3c725a3731c090cc1a1d60e2568558;p=lemmy-ui.git Fixing error for null person_block. Fixes #491 --- diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 0dfff14..3f4f300 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -133,7 +133,7 @@ export class Profile extends Component { } setPersonBlock() { - this.state.personBlocked = UserService.Instance.myUserInfo.person_blocks + this.state.personBlocked = UserService.Instance.myUserInfo?.person_blocks .map(a => a.target.id) .includes(this.state.personRes?.person_view.person.id); } @@ -411,7 +411,7 @@ export class Profile extends Component {
- {!this.isCurrentUser && ( + {!this.isCurrentUser && UserService.Instance.myUserInfo && ( <>