Fix small bug introduced in c236bf3

This commit is contained in:
Christopher Gurnee 2022-03-17 17:28:49 +00:00
parent 56b05821fc
commit ee1bef62dd

View file

@ -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