Skip to content

Commit 0710f5a

Browse files
authored
Merge pull request #447 from aliaspooryorik/develop
sheetToArrayOfStructs throws array-index-out-of-bounds when rows have trailing blank cells
2 parents 48d8465 + 3ac7eda commit 0710f5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

helpers/sheet.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ component extends="base"{
204204
return ArrayMap( intermediateResult.data, ( row )=>{
205205
var rowAsOrderedStruct = [:];
206206
ArrayEach( intermediateResult.columns, ( column, index )=>{
207-
rowAsOrderedStruct[ column ] = row[ index ];
207+
rowAsOrderedStruct[ column ] = ( index <= row.Len() ) ? row[ index ] : "";
208208
});
209209
return rowAsOrderedStruct;
210210
})

0 commit comments

Comments
 (0)