From f28735316eb2aba54645cea8b30eb8ecd66f2b01 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 6 Sep 2021 08:50:23 +1000 Subject: [PATCH] interface: handle undefined group metadata correctly --- pkg/interface/src/logic/lib/util.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/logic/lib/util.tsx b/pkg/interface/src/logic/lib/util.tsx index 8a0b25b828..f3a9ffb43c 100644 --- a/pkg/interface/src/logic/lib/util.tsx +++ b/pkg/interface/src/logic/lib/util.tsx @@ -56,8 +56,11 @@ export function parentPath(path: string) { * string -> enabled feed */ export function getFeedPath(association: Association): string | null | undefined { - const { metadata = { config: {} } } = association; - if (metadata.config && 'group' in metadata?.config && metadata.config?.group) { + const metadata = association?.metadata; + if(!metadata) { + return undefined; + } + if (metadata?.config && 'group' in metadata?.config && metadata.config?.group) { if ('resource' in metadata.config.group) { return metadata.config.group.resource; }