From d088646098991a76d179340c545a87b04b1aba12 Mon Sep 17 00:00:00 2001 From: Andy Dufilie Date: Thu, 21 Jan 2016 14:01:48 -0500 Subject: [PATCH] fixed isWithinBar() crash when there were less than 2 items in pathSegList --- src/shape.bar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shape.bar.js b/src/shape.bar.js index 514b7f0..f094ae4 100644 --- a/src/shape.bar.js +++ b/src/shape.bar.js @@ -113,6 +113,9 @@ c3_chart_internal_fn.generateGetBarPoints = function (barIndices, isSub) { }; }; c3_chart_internal_fn.isWithinBar = function (that) { + if (that.pathSegList.numberOfItems < 2) { + return false; + } var mouse = this.d3.mouse(that), box = that.getBoundingClientRect(), seg0 = that.pathSegList.getItem(0), seg1 = that.pathSegList.getItem(1), x = Math.min(seg0.x, seg1.x), y = Math.min(seg0.y, seg1.y),