Skip to content

Commit ea4b46b

Browse files
committed
chore: check record for empty string when it should have field value
1 parent 81fcf02 commit ea4b46b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/web/src/features/upload/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ export function interpretZodObjectValue(
251251
const recordArrayObject: { [key: string]: any } = {};
252252

253253
const record = listData.split(',');
254+
if (record.some((str) => str === '')) {
255+
return { message: `One or more of the record array fields was left empty`, success: false };
256+
}
254257
if (!(zList.length === zKeys.length && zList.length === record.length)) {
255258
return { message: `Incorrect number of entries for record array`, success: false };
256259
}

0 commit comments

Comments
 (0)