From 500de79b5d5e9bda45e42c0dfecc730720d601a0 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Fri, 12 Jun 2020 16:33:38 +0200 Subject: [PATCH] Sometimes at the very start no profiles provided. (#5591) At the first start the nightscout is crashed if profile not full. --- lib/data/ddata.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/data/ddata.js b/lib/data/ddata.js index b5226124ccf..ed0830b270a 100644 --- a/lib/data/ddata.js +++ b/lib/data/ddata.js @@ -41,7 +41,7 @@ function init () { results.cals = ddata.cals; var profiles = _.cloneDeep(ddata.profiles); - if (profiles && profiles[0]) { + if (profiles && profiles[0] && profiles[0].store) { Object.keys(profiles[0].store).forEach(k => { if (k.indexOf('@@@@@') > 0) { delete profiles[0].store[k];