From 4abb9b138359a2365a45287eb69abab15f23a6e2 Mon Sep 17 00:00:00 2001 From: Steve Dodier-Lazaro Date: Thu, 5 Dec 2024 12:13:43 +0100 Subject: [PATCH] fix: Handle potentially missing upstream story data --- src/useBadgesToDisplay.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/useBadgesToDisplay.ts b/src/useBadgesToDisplay.ts index da5eb39..19724a5 100644 --- a/src/useBadgesToDisplay.ts +++ b/src/useBadgesToDisplay.ts @@ -24,6 +24,11 @@ export function useBadgesToDisplay({ type, }: UseBadgesToDisplayOptions): BadgesToDisplay { return useMemo(() => { + /* Handle potentially missing data from callees. */ + if (!tags || !type) { + return [] + } + return (parameters || []) .map((config) => ({ ...config,