From 9117435f91b045c53435dde4a9c0bdf285e0f2e3 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 29 May 2023 17:24:26 -0400 Subject: [PATCH] if we get garbage from frontend for nonessential feature, do not blow up --- spiffworkflow-frontend/src/components/ActiveUsers.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spiffworkflow-frontend/src/components/ActiveUsers.tsx b/spiffworkflow-frontend/src/components/ActiveUsers.tsx index aa9722752..87b2e885d 100644 --- a/spiffworkflow-frontend/src/components/ActiveUsers.tsx +++ b/spiffworkflow-frontend/src/components/ActiveUsers.tsx @@ -40,6 +40,12 @@ export default function ActiveUsers() { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); // it is critical to only run this once. + // activeUsers is supposed to be an array, but it is based on the response body + // from a network call, so who knows what might happen. Be safe. + if (!activeUsers.map) { + return null; + } + const au = activeUsers.map((activeUser: User) => { return (