Skip to content

Commit a0df17e

Browse files
committed
Fix off-by-one in validation error row index
Account for the header row when reporting CSV line numbers. PapaParse with header:true excludes the header from data, so data[0] is line 2 in the original file.
1 parent 4123b03 commit a0df17e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_resolution_file_uploader

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_resolution_file_uploader/validations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const validateParsedRows = (
112112
const error = validateRow(row);
113113
if (error) {
114114
invalid.push(row);
115-
errors.push({ message: error, index: i + 1 }); // 1-based original CSV row number
115+
errors.push({ message: error, index: i + 2 }); // +2: 1-based + skip header row
116116
} else {
117117
valid.push(row);
118118
}

0 commit comments

Comments
 (0)