From 2d13c0a00adc54ddba1b1d76cd95d5c5e2da10a9 Mon Sep 17 00:00:00 2001 From: Max Bruchmann Date: Thu, 31 Oct 2013 17:55:19 +0100 Subject: [PATCH] fixed invalid index in buildChangeDetails, fixes #1858 --- select2.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index a286377d..70c63e31 100644 --- a/select2.js +++ b/select2.js @@ -3005,7 +3005,9 @@ the specific language governing permissions and limitations under the Apache Lic for (var j = 0; j < old.length; j++) { if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) { current.splice(i, 1); - i--; + if(i>0){ + i--; + } old.splice(j, 1); j--; }