From ff4e2fb65b68b711e0ec2f1b072dbac52edd5c16 Mon Sep 17 00:00:00 2001 From: Daniel LaLiberte Date: Sat, 2 Dec 2023 16:54:27 +0000 Subject: [PATCH] Return undefined when numeric field is empty string. --- client-src/elements/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client-src/elements/utils.js b/client-src/elements/utils.js index a4f371875542..ce5bdbeda6f0 100644 --- a/client-src/elements/utils.js +++ b/client-src/elements/utils.js @@ -387,12 +387,14 @@ export function checkMilestoneStartEnd(startEndPair, getFieldValue) { const getValue = (name) => { const value = getFieldValue(name); if (typeof value === 'string') { + if (value === '') return undefined; return Number(value); } }; const {start, end} = startEndPair; const startMilestone = getValue(start); const endMilestone = getValue(end); + console.info(`after getValue: start: ${startMilestone} end: ${endMilestone}`); if (startMilestone != null && endMilestone != null) { if (endMilestone <= startMilestone) { return {error: 'Start milestone must be before end milestone'};