Skip to content

Commit c3a99b6

Browse files
authored
! Fix error when fetching deleted comment replies in local API (#5255)
1 parent fae3dcd commit c3a99b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/renderer/components/watch-video-comments/watch-video-comments.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ export default defineComponent({
260260
/** @type {import('youtubei.js').YTNodes.CommentThread} */
261261
const commentThread = this.replyTokens.get(comment.id)
262262

263+
if (commentThread == null) {
264+
this.replyTokens.delete(comment.id)
265+
comment.hasReplyToken = false
266+
return
267+
}
268+
263269
if (comment.replies.length > 0) {
264270
await commentThread.getContinuation()
265271
comment.replies = comment.replies.concat(commentThread.replies.map(reply => parseLocalComment(reply)))

0 commit comments

Comments
 (0)