From 030ff0c50e1940f97ac8db685929617f88b09289 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 12 Jan 2022 15:38:56 +0000 Subject: [PATCH] Ensure bad route configs don't cause the client to crash --- packages/client/src/stores/routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/stores/routes.js b/packages/client/src/stores/routes.js index 1d5dca1645..98aa50cbbc 100644 --- a/packages/client/src/stores/routes.js +++ b/packages/client/src/stores/routes.js @@ -18,8 +18,8 @@ const createRouteStore = () => { const fetchRoutes = async () => { const routeConfig = await API.fetchRoutes() let routes = [] - Object.values(routeConfig.routes).forEach(route => { - Object.entries(route.subpaths).forEach(([path, config]) => { + Object.values(routeConfig.routes || {}).forEach(route => { + Object.entries(route.subpaths || {}).forEach(([path, config]) => { routes.push({ path, screenId: config.screenId,