Skip to content

Commit

Permalink
Added condition to remove invalud use of view.removeAt().
Browse files Browse the repository at this point in the history
We were passing undefined in some cases to it.
  • Loading branch information
Kanaye committed Dec 2, 2016
1 parent 8c9152e commit 2082eef
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/query/ExtenderHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ define([
action = Action.EXISTS;
skip -= 1;
if (skip >= 0) {
action = Action.REMOVE;
if (getConnection(index) !== undefined) {
action = Action.REMOVE;
} else {
action = Action.NOOP;
}
return false;
} else if (skip < 0 && getConnection(index) === undefined) {
action = Action.ADD;
Expand All @@ -234,7 +238,11 @@ define([

case ExtenderHelper.operations.TAKE:
if (take <= 0) {
action = Action.REMOVE;
if (getConnection(index) === undefined) {
action = Action.NOOP;
} else {
action = Action.REMOVE;
}
return false;
} else {
take -= 1;
Expand Down

0 comments on commit 2082eef

Please sign in to comment.