File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -548,7 +548,8 @@ ${gpxPoints}
548548
549549 const getDisplayRoutes = ( ) => {
550550 if ( suggestedRoute ) return [ ] ;
551- return filteredRoutes ;
551+ // Filter out routes with invalid/empty coordinates to prevent map rendering crash
552+ return filteredRoutes . filter ( r => r . coordinates && r . coordinates . length > 0 && Array . isArray ( r . coordinates [ 0 ] ) ) ;
552553 } ;
553554
554555 const handleAuth = async ( e : React . FormEvent ) => {
@@ -1037,7 +1038,7 @@ ${gpxPoints}
10371038 ) }
10381039
10391040 < div className = { `flex-1 h-[50vh] md:h-auto ${ darkMode ? 'bg-zinc-900' : 'bg-gray-200' } border ${ darkMode ? 'border-zinc-800' : 'border-gray-300' } rounded-2xl overflow-hidden` } >
1040- { routes . length > 0 || suggestedRoute ? (
1041+ { routes . length > 0 || ( suggestedRoute && suggestedRoute . coordinates ?. length > 0 ) ? (
10411042 < MapWithNoSSR
10421043 routes = { suggestedRoute ? [ ] : getDisplayRoutes ( ) }
10431044 selectedRoute = { selectedRoute }
You can’t perform that action at this time.
0 commit comments