Skip to content

Commit 81fcf02

Browse files
committed
chore: return error is the recordArray list of entries incorrect length
1 parent f041717 commit 81fcf02

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

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

253253
const record = listData.split(',');
254-
254+
if (!(zList.length === zKeys.length && zList.length === record.length)) {
255+
return { message: `Incorrect number of entries for record array`, success: false };
256+
}
255257
for (let i = 0; i < record.length; i++) {
256258
// TODO - make sure this is defined
257259
const recordValue = record[i]!.split(':')[1]!;

0 commit comments

Comments
 (0)