Skip to content

Commit

Permalink
Add proper check on row value
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-griffin committed Jun 17, 2019
1 parent bdab5fe commit 7d6e3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/requestUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const removeInvalidObjects = (originalData = [], invalidData = {}) => {
// is an error message.
const { row } = errorObject;
// If the row value is valid, remove the index from the original data
if (!Number.isInteger(Number(row)) || row >= invalidData.length) return;
if (!Number.isInteger(Number(row)) || row >= originalDataClone.length) return;
const [invalidDatum] = originalDataClone.splice(row, 1);
// If the invalidDatum exists, push it to the invalid objects array.
if (!invalidDatum) return;
Expand Down

0 comments on commit 7d6e3d4

Please sign in to comment.