From 8cc4108bdb0db5006d794be50d1bbca9558373e9 Mon Sep 17 00:00:00 2001 From: Majlen Date: Mon, 12 Sep 2016 17:43:49 +0200 Subject: [PATCH 1/1] Check that setRow is not negative, fixes #644. (#773) Synchronization breaks up if this case is not checked. Fix has been proposed in the bugreport. --- src/dygraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dygraph.js b/src/dygraph.js index ff3bcb6..3ffc2e6 100644 --- a/src/dygraph.js +++ b/src/dygraph.js @@ -1813,7 +1813,7 @@ Dygraph.prototype.setSelection = function(row, opt_seriesName, opt_locked) { // for. If it is, just use it, otherwise search the array for a point // in the proper place. var setRow = row - this.getLeftBoundary_(setIdx); - if (setRow < points.length && points[setRow].idx == row) { + if (setRow >= 0 && setRow < points.length && points[setRow].idx == row) { var point = points[setRow]; if (point.yval !== null) this.selPoints_.push(point); } else { -- 2.7.4