Jelajahi Sumber

fixed invalid index in buildChangeDetails, fixes #1858

Max Bruchmann 11 tahun lalu
induk
melakukan
2d13c0a00a
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      select2.js

+ 3 - 1
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--;
                     }