changeset 53f2f4d70e04 in sao:5.0 details: https://hg.tryton.org/sao?cmd=changeset;node=53f2f4d70e04 description: Ensure inserted record has a valid position
issue9731 review298881002 (grafted from b028a776dcda25244877378e41fcb6e43b322b27) diffstat: src/model.js | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (11 lines): diff -r 868f316bd9aa -r 53f2f4d70e04 src/model.js --- a/src/model.js Wed Oct 21 23:15:18 2020 +0200 +++ b/src/model.js Sat Oct 24 13:12:01 2020 +0200 @@ -141,6 +141,7 @@ if ((position === undefined) || (position == -1)) { position = this.length; } + position = Math.min(position, this.length); if (changed === undefined) { changed = true; }