From aac194616ad46ffdda37a36eb63d7e34a6f652c3 Mon Sep 17 00:00:00 2001 From: Sajjad Hashemian Date: Tue, 12 Jun 2018 17:58:01 +0430 Subject: [PATCH] check class string before concat --- js/src/forum/components/CommentPost.js | 2 +- js/src/forum/components/EventPost.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/forum/components/CommentPost.js b/js/src/forum/components/CommentPost.js index e3c90cbc4..1c7020322 100644 --- a/js/src/forum/components/CommentPost.js +++ b/js/src/forum/components/CommentPost.js @@ -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(), diff --git a/js/src/forum/components/EventPost.js b/js/src/forum/components/EventPost.js index f4645275c..d059e7dc0 100644 --- a/js/src/forum/components/EventPost.js +++ b/js/src/forum/components/EventPost.js @@ -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; }