mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-04 19:12:51 +00:00
Fix cycle operator crashing if step size is larger than the number of operands
See https://talk.tiddlywiki.org/t/bug-report-javascript-error-at-tw-com-within-cycle-operator-try-it/9430/1
This commit is contained in:
parent
31ec1bdd50
commit
801ed0ea11
@ -202,7 +202,7 @@ Extended filter operators to manipulate the current list.
|
|||||||
}
|
}
|
||||||
if(resultsIndex !== -1) {
|
if(resultsIndex !== -1) {
|
||||||
i = i + step;
|
i = i + step;
|
||||||
nextOperandIndex = (i < opLength ? i : i - opLength);
|
nextOperandIndex = (i < opLength ? i : i % opLength);
|
||||||
if(operands.length > 1) {
|
if(operands.length > 1) {
|
||||||
results.splice(resultsIndex,1,operands[nextOperandIndex]);
|
results.splice(resultsIndex,1,operands[nextOperandIndex]);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user