From 189687595ee99b31e231c13842bd4b1a66372f6d Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sat, 3 Jun 2017 21:35:52 +0500 Subject: [PATCH] Fix bug trying to parse undefined news --- .../src/extension-common/pages/options/src/components/App.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js index 54d914d..d67a186 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js @@ -108,7 +108,8 @@ export default function getApp(theState) { const ifNews = (() => { if (!(comments && comments.length)) { - const news = JSON.parse(localStorage[uiLastNewsArr]); + const json = localStorage[uiLastNewsArr]; + const news = json && JSON.parse(json); if (news) { this.setNewsStatusTo(news); return true;