From 20cb4695b0b63474711618919a8befd19b326923 Mon Sep 17 00:00:00 2001 From: etimberg Date: Sun, 30 Sep 2018 18:20:10 -0400 Subject: [PATCH] Ensure that when the time axis accesses `data.labels` it actually exists --- src/scales/scale.time.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 2496a487c3e..405d8ff8c80 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