mirror of
https://github.com/flarum/core.git
synced 2025-07-16 14:26:25 +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:
@ -138,7 +138,7 @@ export default class Post extends Component {
|
|||||||
classes.push('Post--by-actor');
|
classes.push('Post--by-actor');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user?.id() === discussion.attribute('startUserId')) {
|
if (user && user?.id() === discussion.attribute('startUserId')) {
|
||||||
classes.push('Post--by-start-user');
|
classes.push('Post--by-start-user');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user