From ddac5c2c850e582e964e8c2a486837272962b426 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Thu, 29 Jun 2017 10:48:29 -0300 Subject: [PATCH] Avoid Error due to invalid queries --- client/coral-embed-stream/src/components/Stream.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index 165b3ce4c..54a077c83 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -163,6 +163,7 @@ class Stream extends React.Component { pluginProps, editName } = this.props; + const {keepCommentBox} = this.state; const view = this.getVisibleComments(); const open = asset.closedAt === null; @@ -187,6 +188,12 @@ class Stream extends React.Component { }; const showCommentBox = loggedIn && ((!banned && !temporarilySuspended && !highlightedComment) || keepCommentBox); + + if (!comment && !comments) { + console.error('No comments came back from the graph given that query. Please, check the query params.'); + return
An error has occured!
; + } + return (