Update renderThreadComments.js

This commit is contained in:
plebbitor
2023-04-15 21:11:37 +02:00
parent e636258f0f
commit d982d31961
+1 -1
View File
@@ -1,5 +1,5 @@
function renderThreadComments(comments) { function renderThreadComments(comments) {
const commentKeys = Object.keys(comments); const commentKeys = Object.keys(comments? comments : {});
const renderedComments = commentKeys.map(key => { const renderedComments = commentKeys.map(key => {
const comment = comments[key]; const comment = comments[key];
const { replies: { pages: { topAll: { comments: nestedComments = [] } = {} } = {} } = {} } = comment; const { replies: { pages: { topAll: { comments: nestedComments = [] } = {} } = {} } = {} } = comment;