Fix bug trying to parse undefined news

This commit is contained in:
Ilya Ig. Petrov 2017-06-03 21:35:52 +05:00
parent b93958a8aa
commit 189687595e

View File

@ -108,7 +108,8 @@ export default function getApp(theState) {
const ifNews = (() => { const ifNews = (() => {
if (!(comments && comments.length)) { if (!(comments && comments.length)) {
const news = JSON.parse(localStorage[uiLastNewsArr]); const json = localStorage[uiLastNewsArr];
const news = json && JSON.parse(json);
if (news) { if (news) {
this.setNewsStatusTo(news); this.setNewsStatusTo(news);
return true; return true;