From 13dcccc60bba90f0883aae63e72aac896a6f553c Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 8 Nov 2016 11:47:42 -0500 Subject: PLT-4205 Fixed pending posts always being considered as part of a post thread (#4488) --- webapp/components/post_view/components/post_list.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'webapp/components/post_view') diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index 400f516cc..a0cfb208e 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -272,11 +272,13 @@ export default class PostList extends React.Component { commentRootId = post.id; } - for (const postId in posts) { - if (posts[postId].root_id === commentRootId) { - commentCount += 1; - if (posts[postId].user_id === userId) { - shouldHighlightThreads = true; + if (commentRootId) { + for (const postId in posts) { + if (posts[postId].root_id === commentRootId) { + commentCount += 1; + if (posts[postId].user_id === userId) { + shouldHighlightThreads = true; + } } } } -- cgit v1.2.3-1-g7c22