From c84c91dc204e72195e509e6a3f0fd00770efdca4 Mon Sep 17 00:00:00 2001 From: Samuel Rowe Date: Mon, 1 Aug 2022 00:07:24 +0530 Subject: [PATCH] feat(frontend): added another defensive error `Records` component --- services/frontend/src/components/Records.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/frontend/src/components/Records.tsx b/services/frontend/src/components/Records.tsx index 9a256a8..9496246 100644 --- a/services/frontend/src/components/Records.tsx +++ b/services/frontend/src/components/Records.tsx @@ -129,6 +129,10 @@ const Records: FunctionComponent = ( throw new Error(`"${name}" is falsy.`); } + if (!Array.isArray(items)) { + throw new Error(`Expected "${name}" to be an array.`); + } + const empty = items && items.length === 0; return (