1
0
mirror of https://github.com/flarum/core.git synced 2025-07-15 13:56:23 +02:00

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.
This commit is contained in:
Alexander Skvortsov
2022-01-08 18:26:47 -05:00
parent 4a5081fa4c
commit b8b2941ca6

View File

@ -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');
}