]> Untitled Git - lemmy-ui.git/commitdiff
Fixing error for null person_block. Fixes #491
authorDessalines <tyhou13@gmx.com>
Thu, 18 Nov 2021 15:33:27 +0000 (10:33 -0500)
committerDessalines <tyhou13@gmx.com>
Thu, 18 Nov 2021 15:33:27 +0000 (10:33 -0500)
src/shared/components/person/profile.tsx

index 0dfff14cbf426667f777458c14edbe57b661c03b..3f4f30035a7d05ea380087aef4b6fbc9eed71d83 100644 (file)
@@ -133,7 +133,7 @@ export class Profile extends Component<any, ProfileState> {
   }
 
   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<any, ProfileState> {
                 </ul>
               </div>
               <div className="flex-grow-1 unselectable pointer mx-2"></div>
-              {!this.isCurrentUser && (
+              {!this.isCurrentUser && UserService.Instance.myUserInfo && (
                 <>
                   <a
                     className={`d-flex align-self-start btn btn-secondary mr-2 ${