Skip to content

Commit 0b078fa

Browse files
committed
Fix: undefined endDate
1 parent edaf2fb commit 0b078fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/bot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,8 @@ async function update(req, res) {
426426
);
427427
} else {
428428
try {
429-
if (data.endDate === "") data.endDate = null;
430-
if (data.startDate === "") data.startDate = null;
429+
if (data.endDate === undefined || data.endDate === "") data.endDate = null;
430+
if (data.startDate === undefined || data.startDate === "") data.startDate = null;
431431
// Loop over transformers to verify if they exist or not.
432432
const userSegments = data.users;
433433
let isValidUserSegment = true;

0 commit comments

Comments
 (0)