Commit 0fad80c0 authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

getInferredValuesList() : protection against null min/max

parent 05990896
...@@ -117,7 +117,11 @@ export class ParamValues implements IterableValues { ...@@ -117,7 +117,11 @@ export class ParamValues implements IterableValues {
public getInferredValuesList(reverse: boolean = false, extendTo?: number, addLastStep: boolean = false) { public getInferredValuesList(reverse: boolean = false, extendTo?: number, addLastStep: boolean = false) {
if ([ ParamValueMode.MINMAX, ParamValueMode.LISTE ].includes(this.valueMode)) { if ([ ParamValueMode.MINMAX, ParamValueMode.LISTE ].includes(this.valueMode)) {
// protection against infinite loops // protection against infinite loops
if (this.step !== undefined && this.step > 0) { if (
this.step !== undefined && this.step > 0
&& this.min !== undefined && this.min !== null
&& this.max !== undefined && this.max !== null
) {
const it = this.initValuesIterator(reverse, extendTo, addLastStep); const it = this.initValuesIterator(reverse, extendTo, addLastStep);
const values: number[] = []; const values: number[] = [];
for (const v of it) { for (const v of it) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment