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))
}
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