mirror of
https://github.com/flarum/core.git
synced 2025-07-17 14:51:19 +02:00
Merge pull request #1456 from sijad/prevent-undefined
check class string before concat
This commit is contained in:
@@ -80,7 +80,7 @@ export default class CommentPost extends Post {
|
||||
const post = this.props.post;
|
||||
const attrs = super.attrs();
|
||||
|
||||
attrs.className += ' '+classList({
|
||||
attrs.className = (attrs.className || '') + ' ' + classList({
|
||||
'CommentPost': true,
|
||||
'Post--hidden': post.isHidden(),
|
||||
'Post--edited': post.isEdited(),
|
||||
|
@@ -18,7 +18,7 @@ export default class EventPost extends Post {
|
||||
attrs() {
|
||||
const attrs = super.attrs();
|
||||
|
||||
attrs.className += ' EventPost ' + ucfirst(this.props.post.contentType()) + 'Post';
|
||||
attrs.className = (attrs.className || '') + ' EventPost ' + ucfirst(this.props.post.contentType()) + 'Post';
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
Reference in New Issue
Block a user