From 7916261c5c8c680d064fba106619d733575bc39c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 2 Aug 2023 10:06:06 +0200 Subject: [PATCH] fix(front): avoid crashing if we don't have configuration data in time when in guard Signed-off-by: Thomas Citharel --- js/src/router/guards/register-guard.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/js/src/router/guards/register-guard.ts b/js/src/router/guards/register-guard.ts index 9cde41b92..07b886b5c 100644 --- a/js/src/router/guards/register-guard.ts +++ b/js/src/router/guards/register-guard.ts @@ -12,6 +12,7 @@ export const beforeRegisterGuard: NavigationGuard = async (to, from, next) => { ); onResult(({ data }) => { + if (!data) return next(); const { config } = data; if (!config.registrationsOpen && !config.registrationsAllowlist) {