changeset 5a25cfb55277 in sao:5.6
details: https://hg.tryton.org/sao?cmd=changeset;node=5a25cfb55277
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 4059e9f8d6f0 -r 5a25cfb55277 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
@@ -142,6 +142,7 @@
if ((position === undefined) || (position == -1)) {
position = this.length;
}
+ position = Math.min(position, this.length);
if (changed === undefined) {
changed = true;
}