From 18c825e99687d0fe945deff87f9fd849ea813221 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Wed, 12 Jun 2024 09:58:39 +0800 Subject: [PATCH] ! Fix error when fetching deleted comment replies in local API --- .../components/watch-video-comments/watch-video-comments.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.js b/src/renderer/components/watch-video-comments/watch-video-comments.js index 339d7226baac7..f5819de30b0a4 100644 --- a/src/renderer/components/watch-video-comments/watch-video-comments.js +++ b/src/renderer/components/watch-video-comments/watch-video-comments.js @@ -260,6 +260,12 @@ export default defineComponent({ /** @type {import('youtubei.js').YTNodes.CommentThread} */ const commentThread = this.replyTokens.get(comment.id) + if (commentThread == null) { + this.replyTokens.delete(comment.id) + comment.hasReplyToken = false + return + } + if (comment.replies.length > 0) { await commentThread.getContinuation() comment.replies = comment.replies.concat(commentThread.replies.map(reply => parseLocalComment(reply)))