From 7d6e3d4d0ec62fb1bfaab2e32d42004a78328826 Mon Sep 17 00:00:00 2001 From: joshxg Date: Tue, 18 Jun 2019 11:56:31 +1200 Subject: [PATCH] Add proper check on row value --- src/utilities/requestUtilities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/requestUtilities.js b/src/utilities/requestUtilities.js index 023a346..c6f19e6 100644 --- a/src/utilities/requestUtilities.js +++ b/src/utilities/requestUtilities.js @@ -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;