From 1e410dec1e8e753ea9d1c539ec447e7fd2bb6fbd Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Tue, 19 Dec 2023 12:10:54 -0500 Subject: [PATCH] Fix invalid null value access --- cypress/integration/task/files_tables.ts | 2 +- .../task/taskTabs/FileTable/GroupedFileTable/index.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cypress/integration/task/files_tables.ts b/cypress/integration/task/files_tables.ts index fea7593da7..f4eacf1e2e 100644 --- a/cypress/integration/task/files_tables.ts +++ b/cypress/integration/task/files_tables.ts @@ -1,7 +1,7 @@ describe("files table", () => { const FILES_ROUTE = "/task/evergreen_ubuntu1604_89/files"; const FILES_ROUTE_WITHOUT_FILES = - "/task/evergreen_ubuntu1604_test_model_commitqueue_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/files "; + "/task/evergreen_ubuntu1604_test_model_commitqueue_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/files"; it("File names under name column should link to a new tab", () => { cy.visit(FILES_ROUTE); diff --git a/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx b/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx index 8cdafae0b8..fffb8bfe4a 100644 --- a/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx +++ b/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx @@ -55,7 +55,9 @@ const columns = ( disabled={value.row.original.urlParsley === null} size="small" ref={ - options.index === value.row.index ? options.triggerRef : null + options && options.index === value.row.index + ? options.triggerRef + : null } onClick={() => { taskAnalytics.sendEvent({ @@ -106,7 +108,10 @@ const GroupedFileTable: React.FC = ({ triggerRef: parsleyLinkRef, index: firstParsleyFileIndex, } - : null + : { + triggerRef: null, + index: -1, + } ), [taskAnalytics, firstParsleyFileIndex] );