From 81bd983f0bf231a1bbd99aaa15ed9c9b03710139 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 13 Apr 2017 01:34:27 +0700 Subject: [PATCH] Handle empty stream case --- client/coral-embed-stream/src/Embed.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index a16852c00..6d20e011a 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -129,9 +129,11 @@ class Embed extends Component { const banned = user && user.status === 'BANNED'; - const hasOlderComments = - asset && asset.lastComment && - asset.lastComment.id !== asset.comments[asset.comments.length - 1].id; + const hasOlderComments = !!( + asset && + asset.lastComment && + asset.lastComment.id !== asset.comments[asset.comments.length - 1].id + ); const expandForLogin = showSignInDialog ? { minHeight: document.body.scrollHeight + 200