Skip to content

Commit

Permalink
Fix binarySearch for empty dataset (#7023)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored and etimberg committed Jan 28, 2020
1 parent 1ae11c4 commit cb6d7f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/core.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function evaluateAllVisibleItems(chart, handler) {
function binarySearch(metaset, axis, value, intersect) {
const {controller, data, _sorted} = metaset;
const iScale = controller._cachedMeta.iScale;
if (iScale && axis === iScale.axis && _sorted) {
if (iScale && axis === iScale.axis && _sorted && data.length) {
const lookupMethod = iScale._reversePixels ? _rlookup : _lookup;
if (!intersect) {
return lookupMethod(data, axis, value);
Expand Down

0 comments on commit cb6d7f8

Please sign in to comment.