diff --git a/history.txt b/history.txt index 2d7e53ed..819dcf03 100755 --- a/history.txt +++ b/history.txt @@ -2347,3 +2347,4 @@ ______ * Threads: Fixed #318 * Objects: Fixed #416 * Objects: Fixed #372 +* Threads: Fixed #644 diff --git a/threads.js b/threads.js index d5040c58..574fd353 100644 --- a/threads.js +++ b/threads.js @@ -1307,7 +1307,7 @@ Process.prototype.doInsertInList = function (element, index, list) { return null; } if (this.inputOption(index) === 'any') { - idx = this.reportRandom(1, list.length()); + idx = this.reportRandom(1, list.length() + 1); } if (this.inputOption(index) === 'last') { idx = list.length() + 1;