Safeguard the plugins use to avoid the flatMap error occurred during hot reloading (#23831)

This commit is contained in:
Aniket Katkar 2025-10-10 18:14:00 +05:30 committed by GitHub
parent 1fa5641590
commit 13ab5af508
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ const AppRouter = () => {
{/* Render APP position plugin routes (they handle their own layouts) */}
{isAuthenticated &&
plugins.flatMap((plugin) => {
plugins?.flatMap((plugin) => {
const routes = plugin.getRoutes?.() || [];
// Filter routes with APP position
const appRoutes = routes.filter(

View File

@ -292,7 +292,7 @@ const AuthenticatedAppRouter: FunctionComponent = () => {
// Get all plugin routes that should be in AUTHENTICATED_ROUTE position
const pluginRoutes = useMemo(() => {
return plugins.flatMap((plugin) => {
return plugins?.flatMap((plugin) => {
const routes = plugin.getRoutes?.() || [];
// Filter routes that don't have position or have AUTHENTICATED_ROUTE position