From ee25b34648e6f26057fb288b3abdf83b39e8fd91 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:24:01 +0100 Subject: [PATCH] fix: check user exists before we try and set it in the map --- .../dashboard/games/_game/_playtype/GPTChartPage.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx index d06cc96f2..1e815908f 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx @@ -147,9 +147,11 @@ function InternalGPTChartPage({ userMap.set(user.id, user); } } - - // Add current user, since there's no guarantee they are returned from either API. - userMap.set(user.id, user); + + if (user) { + // Add current user, since there's no guarantee they are returned from either API. + userMap.set(user.id, user); + } return (