mirror of
https://github.com/flarum/framework.git
synced 2025-02-26 13:27:25 +08: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:
parent
aa44677df3
commit
67821d95bd
@ -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');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user