Skip to content

Commit

Permalink
Return undefined when numeric field is empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlaliberte committed Dec 2, 2023
1 parent 22774fe commit ff4e2fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client-src/elements/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'};
Expand Down

0 comments on commit ff4e2fb

Please sign in to comment.