Ensure bad route configs don't cause the client to crash

This commit is contained in:
Andrew Kingston 2022-01-12 15:38:56 +00:00
parent 159c951262
commit d949e2dd23
1 changed files with 2 additions and 2 deletions

View File

@ -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,