From 7cc728ca69c44d992f639a455585e24b3ab24724 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 4 Aug 2022 11:21:31 +0100 Subject: [PATCH] Fix issue when using an invalid user ID in url --- .../src/pages/builder/portal/manage/users/[userId].svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte index a77f8a4872..686223ff39 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -188,6 +188,9 @@ async function fetchUser(userId) { let userPromise = users.get(userId) user = await userPromise + if (!user?._id) { + $goto("./") + } } async function toggleFlags(detail) {