Skip to content

Commit

Permalink
chore: Check if labels is defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitris - Rafail Katsampas authored and CatchABus committed Nov 7, 2021
1 parent 6cc882d commit 633a52b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/core.datasetController.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,12 @@ export default class DatasetController {
const dataset = this.getDataset();
let stackChanged = false;

this._dataCheck();
let labels = me.chart.data.labels;
if (labels && labels.length && (me._parsing === false || isObject(me._parsing))) {
labels.splice(0);
}

me._dataCheck();

// make sure cached _stacked status is current
const oldStacked = meta._stacked;
Expand Down

0 comments on commit 633a52b

Please sign in to comment.