From 02b73a8b14aa59722399258312af0e1d4460546f Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Tue, 28 Jan 2020 04:20:48 +0000 Subject: [PATCH] Fix cache load race condition bug --- webclient/src/Article.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webclient/src/Article.js b/webclient/src/Article.js index 2e5e376..6d74d2e 100644 --- a/webclient/src/Article.js +++ b/webclient/src/Article.js @@ -24,7 +24,9 @@ class Article extends React.Component { localForage.getItem(id) .then( (value) => { - this.setState({ story: value }); + if (value) { + this.setState({ story: value }); + } } );