From 67821d95bd59c4278bc45c1c12efe06b87fa4b38 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sat, 8 Jan 2022 18:26:47 -0500 Subject: [PATCH] fix: Ensure `user` not false in post component If no information about a relation exists, it will return false, not undefined. Therefore, the nullsafe operator is not enough to avoid issues here. --- js/src/forum/components/Post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/forum/components/Post.js b/js/src/forum/components/Post.js index 5fd0c8e5f..df13321ec 100644 --- a/js/src/forum/components/Post.js +++ b/js/src/forum/components/Post.js @@ -138,7 +138,7 @@ export default class Post extends Component { classes.push('Post--by-actor'); } - if (user?.id() === discussion.attribute('startUserId')) { + if (user && user?.id() === discussion.attribute('startUserId')) { classes.push('Post--by-start-user'); }