22541 harden breadcrumb mapped route resolver against invalid entries

This commit is contained in:
2026-04-09 14:45:12 +01:00
parent 2a84056a76
commit 0cd78e6f46
3 changed files with 66 additions and 2 deletions
+8 -2
View File
@@ -1,5 +1,11 @@
const getMappedRendererByPath = (path, routeRendererMap) =>
routeRendererMap[path] || null;
const getMappedRendererByPath = (path, routeRendererMap) => {
if (!routeRendererMap || typeof routeRendererMap !== "object") {
return null;
}
const routeRenderer = routeRendererMap[path];
return typeof routeRenderer === "function" ? routeRenderer : null;
};
const resolveMappedRouteRenderer = (path, routeRendererMaps = []) => {
for (const routeRendererMap of routeRendererMaps) {