From c4c28a84d61708f055dc2b93398b898c936ee67f Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 10 Apr 2025 12:24:07 -0600 Subject: [PATCH] adding nil check on rows before accessing length --- src/common/ResponsiveTable.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index 3916dd8..7352d76 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -347,7 +347,7 @@ export default function ResponsiveTable(props: Props) { ) })} - {rows.length < 1 && + {(rows && rows.length < 1) && (!isLoading ? { noDataMessage ? noDataMessage : "No data."} @@ -430,7 +430,7 @@ export default function ResponsiveTable(props: Props) { ) }) - : rows.length > 0 && + : (rows && rows.length > 0) && Object.keys(rows[0]).map((value, index) => { return( @@ -516,7 +516,7 @@ export default function ResponsiveTable(props: Props) { ) }) } - {rows.length < 1 && !isLoading && + {(rows && rows.length)< 1 && !isLoading &&