]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-comment.ts
Log typo
[github/Chocobozzz/PeerTube.git] / server / lib / video-comment.ts
index 70ba7c3039cd947c3636d65d64418e80f810d111..bfe22d225b88ecfb7b7b3aa6846f2e35c41b492c 100644 (file)
@@ -28,7 +28,7 @@ async function createVideoComment (obj: {
     videoId: obj.video.id,
     accountId: obj.account.id,
     url: 'fake url'
-  }, { transaction: t, validate: false })
+  }, { transaction: t, validate: false } as any) // FIXME: sequelize typings
 
   comment.set('url', getVideoCommentActivityPubUrl(obj.video, comment))
 
@@ -64,10 +64,8 @@ function buildFormattedCommentTree (resultList: ResultList<VideoCommentModel>):
     }
 
     const parentCommentThread = idx[childComment.inReplyToCommentId]
-    if (!parentCommentThread) {
-      const msg = `Cannot format video thread tree, parent ${childComment.inReplyToCommentId} not found for child ${childComment.id}`
-      throw new Error(msg)
-    }
+    // Maybe the parent comment was blocked by the admin/user
+    if (!parentCommentThread) continue
 
     parentCommentThread.children.push(childCommentThread)
     idx[childComment.id] = childCommentThread