From: Jérôme Benoit Date: Mon, 24 Oct 2022 13:31:05 +0000 (+0200) Subject: Fix random integer generator X-Git-Tag: v1.1.86~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1f86b121076f7bed00f42e3f58c9f09166eda7ff;p=e-mobility-charging-stations-simulator.git Fix random integer generator Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 18d56497..e8e658d1 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -119,7 +119,7 @@ export default class Utils { throw new RangeError('Invalid interval'); } max = Math.floor(max); - if (min) { + if (!Utils.isNullOrUndefined(min) && min !== 0) { if (max < min || min < 0) { throw new RangeError('Invalid interval'); }