]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comment.component.ts
Fix add comment in threads with deleted comments
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comment.component.ts
index f7eca45fda269af958f507485eaa0c0efbb5b5db..1313b658534e4e5b03b1efcda274787f7918cb7d 100644 (file)
@@ -125,7 +125,12 @@ export class VideoCommentComponent implements OnInit, OnChanges {
     const html = await this.markdownService.textMarkdownToHTML(this.comment.text, true)
     this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(html)
     this.newParentComments = this.parentComments.concat([ this.comment ])
-    this.commentAccount = new Account(this.comment.account)
-    this.getUserIfNeeded(this.commentAccount)
+
+    if (this.comment.account) {
+      this.commentAccount = new Account(this.comment.account)
+      this.getUserIfNeeded(this.commentAccount)
+    } else {
+      this.comment.account = null
+    }
   }
 }