diff --git a/src/validators/ohri-form-validator.ts b/src/validators/ohri-form-validator.ts index de9d5304..9b413bc2 100644 --- a/src/validators/ohri-form-validator.ts +++ b/src/validators/ohri-form-validator.ts @@ -32,7 +32,7 @@ export const OHRIFieldValidator: FieldValidator = { }; export function numberInputRangeValidator(min: number, max: number, inputValue: number) { - if (min && inputValue < Number(min)) { + if (!Number.isNaN(min) && inputValue < min) { return [ { resultType: 'error', @@ -42,7 +42,7 @@ export function numberInputRangeValidator(min: number, max: number, inputValue: ]; } - if (max && inputValue > Number(max)) { + if (!Number.isNaN(max) && inputValue > max) { return [ { resultType: 'error',