Avoid Error due to invalid queries

This commit is contained in:
Belen Curcio
2017-06-29 10:48:29 -03:00
parent 0312530b86
commit ddac5c2c85
@@ -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 <div> An error has occured! </div>;
}
return (
<div id="stream">