diff --git a/src/param/param-values.ts b/src/param/param-values.ts index e072f7266c6914deb8c16937c132d25fca75515b..5452d0296b7e738aac13c6696a10ee02ed3c5e24 100644 --- a/src/param/param-values.ts +++ b/src/param/param-values.ts @@ -119,13 +119,19 @@ export class ParamValues implements IterableValues { return this.valueList; } if (this.valueMode === ParamValueMode.MINMAX) { - const values = [ this.min ]; - let latestVal = this.min + this.step; - while (latestVal <= this.max) { - values.push(latestVal); - latestVal += this.step; + // protection against infinite loops + if (this.step !== undefined && this.step > 0) { + // generate list + const values = [ this.min ]; + let latestVal = this.min + this.step; + while (latestVal <= this.max) { + values.push(latestVal); + latestVal += this.step; + } + return values; + } else { + return []; } - return values; } throw new Error("ParamValues.getInferredValuesList() : incorrect value mode" + ParamValueMode[this.valueMode]); }