From ee1bef62dd5e3398848f0eaba20070ddcc994b39 Mon Sep 17 00:00:00 2001 From: Christopher Gurnee Date: Thu, 17 Mar 2022 17:28:49 +0000 Subject: [PATCH] Fix small bug introduced in c236bf3 --- src/pages/thread/CommentSection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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