From: Evert Timberg Date: Thu, 18 Oct 2018 19:28:49 +0000 (-0400) Subject: Ensure that when the time axis accesses `data.labels` it actually exists (#5750) X-Git-Tag: v2.8.0-rc.1~130 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f815dd51968a0bec9305e1cf14d738d6f23c93aa;p=thirdparty%2FChart.js.git Ensure that when the time axis accesses `data.labels` it actually exists (#5750) --- diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 2496a487c..405d8ff8c 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -534,10 +534,11 @@ module.exports = function() { var datasets = []; var labels = []; var i, j, ilen, jlen, data, timestamp; + var dataLabels = chart.data.labels || []; // Convert labels to timestamps - for (i = 0, ilen = chart.data.labels.length; i < ilen; ++i) { - labels.push(parse(chart.data.labels[i], me)); + for (i = 0, ilen = dataLabels.length; i < ilen; ++i) { + labels.push(parse(dataLabels[i], me)); } // Convert data to timestamps