diff --git a/src/controllers/controller.bar.js b/src/controllers/controller.bar.js index 1221b64c323..82e0bdecb5d 100644 --- a/src/controllers/controller.bar.js +++ b/src/controllers/controller.bar.js @@ -365,15 +365,18 @@ export default class BarController extends DatasetController { const meta = this._cachedMeta; const {iScale, vScale} = meta; const parsed = this.getParsed(index); - const custom = parsed._custom; - const value = isFloatBar(custom) - ? '[' + custom.start + ', ' + custom.end + ']' - : '' + vScale.getLabelForValue(parsed[vScale.axis]); - - return { - label: '' + iScale.getLabelForValue(parsed[iScale.axis]), - value - }; + if (parsed) { + const custom = parsed._custom; + const value = isFloatBar(custom) + ? '[' + custom.start + ', ' + custom.end + ']' + : '' + vScale.getLabelForValue(parsed[vScale.axis]); + + return { + label: '' + iScale.getLabelForValue(parsed[iScale.axis]), + value + }; + } + return {label: '', value: ''}; } initialize() {