From b8b2941ca636d2f073bc84fd940b77d4fb50ab72 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. --- framework/core/js/src/forum/components/Post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/js/src/forum/components/Post.js b/framework/core/js/src/forum/components/Post.js index 5fd0c8e5f..df13321ec 100644 --- a/framework/core/js/src/forum/components/Post.js +++ b/framework/core/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'); }