From 29fb99ef6311033ac793ec6fe0e1f89faeb2fcfe Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sat, 14 Apr 2018 22:26:19 +0300 Subject: [PATCH] set default value of comments array --- web/app/components/root/root.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index a1599cde..d8fb78cc 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -40,7 +40,8 @@ export default class Root extends Component { .catch(() => store.set('user', {})) .finally(() => { api.find({ url }) - .then(({ comments } = {}) => store.set('comments', comments)) + .then(({ comments = [] } = {}) => store.set('comments', comments)) + .catch(() => store.set('comments', [])) .finally(() => { this.setState({ loaded: true,