diff --git a/src/pages/thread/CommentSection.js b/src/pages/thread/CommentSection.js index 8c15c43..c91c201 100644 --- a/src/pages/thread/CommentSection.js +++ b/src/pages/thread/CommentSection.js @@ -10,10 +10,13 @@ const unflatten = (commentMap, root) => { const commentTree = [] commentMap.forEach(comment => { - comment.replies = [] + if (comment) + comment.replies = [] }) commentMap.forEach(comment => { + if (!comment) + return const parentID = comment.parent_id let parentComment