From f12a84e85a373fca172eb14aba15accce5f68d16 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 21 Feb 2018 18:35:04 +0100 Subject: [PATCH] if (volumes.length > 0) { --- .vs/AAOlivia-Plotter/v15/.suo | Bin 18944 -> 18432 bytes Candles.js | 9 ++++++--- Volumes.js | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.vs/AAOlivia-Plotter/v15/.suo b/.vs/AAOlivia-Plotter/v15/.suo index 218bda599228b8d4d0f4076aa6fddd476f7c0df6..77b1e8b0a88f05dd48a7f13eeacfe01917de2ed3 100644 GIT binary patch delta 107 zcmZpe!q_l@ae{#?69W_oFfgzHnT$aE@Bjb*AW`PYjvV$I6G|92G3BtZZeTm?VYRuC m&CXU(9Ha^iqz)JY*}R(%*rzcHmcxY^7$$?*o6TKMG64XeG!*p! delta 72 zcmZpez}PT_ae{#?0}Kc-FbD$Kj6nSF|Ns9WVaCah9QGR%N*FgW<*=|Os9!#0xw(+d P&UW*9`#`2eZXg5zNW~Ja diff --git a/Candles.js b/Candles.js index c93ce7d5b..3d91e94a9 100644 --- a/Candles.js +++ b/Candles.js @@ -391,12 +391,15 @@ let lowerEnd = leftDate.valueOf(); let upperEnd = rightDate.valueOf(); - if (candles[0].begin > lowerEnd || candles[candles.length - 1].end < upperEnd) { + if (candles.length > 0) { - setTimeout(recalculate, 2000); + if (candles[0].begin > lowerEnd || candles[candles.length - 1].end < upperEnd) { - //console.log("File missing while calculating candles, scheduling a recalculation in 2 seconds."); + setTimeout(recalculate, 2000); + //console.log("File missing while calculating candles, scheduling a recalculation in 2 seconds."); + + } } //console.log("Olivia > recalculateUsingDailyFiles > total candles generated : " + candles.length); diff --git a/Volumes.js b/Volumes.js index d36d6f85f..63fe74379 100644 --- a/Volumes.js +++ b/Volumes.js @@ -295,12 +295,15 @@ let lowerEnd = leftDate.valueOf(); let upperEnd = rightDate.valueOf(); - if (volumes[0].begin > lowerEnd || volumes[volumes.length - 1].end < upperEnd) { + if (volumes.length > 0) { - setTimeout(recalculate, 2000); + if (volumes[0].begin > lowerEnd || volumes[volumes.length - 1].end < upperEnd) { - //console.log("File missing while calculating volumes, scheduling a recalculation in 2 seconds."); + setTimeout(recalculate, 2000); + //console.log("File missing while calculating volumes, scheduling a recalculation in 2 seconds."); + + } } //console.log("Olivia > recalculateUsingDailyFiles > total volumes generated : " + volumes.length);