Ensure bad route configs don't cause the client to crash
This commit is contained in:
parent
159c951262
commit
d949e2dd23
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue