We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d1b92c commit 87aa303Copy full SHA for 87aa303
1 file changed
src/core/sceneObjs/special/ModuleObj.js
@@ -670,7 +670,12 @@ class ModuleObj extends BaseSceneObj {
670
} else {
671
let result = [];
672
let loopVars1 = loopVars.slice(1);
673
- const loopLength = (loopVars[0].end - loopVars[0].start) / loopVars[0].step + 1;
+ const span = loopVars[0].end - loopVars[0].start;
674
+ const step = loopVars[0].step;
675
+ if (step === 0 || span * step < 0) {
676
+ throw i18next.t('simulator:sceneObjs.ModuleObj.loopVariableTooLarge', { name: loopVars[0].name });
677
+ }
678
+ const loopLength = span / step + 1;
679
if (loopLength > (self.moduleDef.maxLoopLength || 1000)) {
680
throw i18next.t('simulator:sceneObjs.ModuleObj.loopVariableTooLarge', { name: loopVars[0].name });
681
}
0 commit comments