From 6692c968355586f020f03dfe9fa70b395cfce8be Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Fri, 19 Nov 2021 12:22:55 -0500 Subject: [PATCH] fix(striker-ui): duck-tape AnvilHost to avoid crash when processing undefined host --- striker-ui/components/Hosts/AnvilHost.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/striker-ui/components/Hosts/AnvilHost.tsx b/striker-ui/components/Hosts/AnvilHost.tsx index 1d013707..f69ff2f6 100644 --- a/striker-ui/components/Hosts/AnvilHost.tsx +++ b/striker-ui/components/Hosts/AnvilHost.tsx @@ -75,7 +75,9 @@ const AnvilHost = ({ {hosts && hosts.map( (host): JSX.Element => { - return ( + // Temporary fix: avoid crash when encounter undefined host entry by returning a blank element. + // TODO: figure out why there are undefined host entries. + return host ? ( @@ -153,6 +155,8 @@ const AnvilHost = ({ )} + ) : ( + <> ); }, )}