File tree Expand file tree Collapse file tree
apps/web/src/features/upload Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,14 +299,17 @@ export function interpretZodObjectValue(
299299 const recordArrayObject : { [ key : string ] : any } = { } ;
300300
301301 const record = listData . split ( ',' ) ;
302+
303+ if ( ! record ) {
304+ return { message : `Record in the record array was left undefined` , success : false } ;
305+ }
302306 if ( record . some ( ( str ) => str === '' ) ) {
303307 return { message : `One or more of the record array fields was left empty` , success : false } ;
304308 }
305309 if ( ! ( zList . length === zKeys . length && zList . length === record . length ) ) {
306310 return { message : `Incorrect number of entries for record array` , success : false } ;
307311 }
308312 for ( let i = 0 ; i < record . length ; i ++ ) {
309- // TODO - make sure this is defined
310313 if ( ! record [ i ] ) {
311314 return { message : `Failed to interpret field '${ i } '` , success : false } ;
312315 }
You can’t perform that action at this time.
0 commit comments