Merge pull request #1456 from sijad/prevent-undefined

check class string before concat
This commit is contained in:
Franz Liedke 2018-06-27 21:10:40 +02:00 committed by GitHub
commit afe06ea750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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(),

View File

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