Only pass valid subject parameters when commenting
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -51,7 +51,8 @@ class ActivityService {
|
||||
for (let index in this.toEnhanceWithComments) {
|
||||
if (this.toEnhanceWithComments.hasOwnProperty(index)) {
|
||||
let item = this.toEnhanceWithComments[index];
|
||||
item.commentModel = this.commentCollection.get(item.subject_rich[1].comment);
|
||||
let commentId = Array.isArray(item.subject_rich[1].comment) ? item.subject_rich[1].comment.id : item.subject_rich[1].comment;
|
||||
item.commentModel = this.commentCollection.get(commentId);
|
||||
if (typeof item.commentModel !== 'undefined') {
|
||||
this.toEnhanceWithComments = this.toEnhanceWithComments.filter((entry) => entry.activity_id !== item.activity_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user