From 6d3755d94a9f027c58404f5211cc4b3549b15dae Mon Sep 17 00:00:00 2001 From: Bluefox Date: Mon, 30 Mar 2020 21:31:43 +0200 Subject: [PATCH] Sometimes at the very start no profiles provided. 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];