1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 23:47:32 +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 aa44677df3
commit 67821d95bd

View File

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