Skip to content

Commit

Permalink
fix(ArrayObserver): fix error when removing last array item
Browse files Browse the repository at this point in the history
  • Loading branch information
martingust committed Nov 12, 2015
1 parent 18f08b5 commit 5c8be37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array-observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ModifyArrayObserver extends ModifyCollectionObserver {
array['splice'] = function() {
var methodCallResult = arrayProto['splice'].apply(array, arguments);
var index = arguments[0];
if (index >= array.length) {
if (index >= array.length && array.length > 0) {
index = array.length - 1;
} else if (-index >= array.length) {
index = 0;
Expand Down

0 comments on commit 5c8be37

Please sign in to comment.