From 0450c34e3b98db7e4205dc9642b1cee15a426359 Mon Sep 17 00:00:00 2001 From: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:34:29 -0400 Subject: [PATCH] fix(Icon/Minimal): unknown endpoint handling (#1059) --- client/src/components/Endpoints/Icon.tsx | 3 ++- client/src/components/Endpoints/MinimalIcon.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/components/Endpoints/Icon.tsx b/client/src/components/Endpoints/Icon.tsx index 8065228736..f2627a97ba 100644 --- a/client/src/components/Endpoints/Icon.tsx +++ b/client/src/components/Endpoints/Icon.tsx @@ -77,7 +77,8 @@ const Icon: React.FC = (props) => { default: { icon: , bg: 'grey', name: 'UNKNOWN' }, }; - const { icon, bg, name } = endpointIcons[endpoint ?? 'default']; + const { icon, bg, name } = + endpoint && endpointIcons[endpoint] ? endpointIcons[endpoint] : endpointIcons.default; return (
= (props) => { default: { icon: , name: 'UNKNOWN' }, }; - const { icon, name } = endpointIcons[endpoint]; + const { icon, name } = endpointIcons[endpoint] ?? endpointIcons.default; return (