File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/nextjs/src/performance Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -197,16 +197,18 @@ export function nextRouterInstrumentation(
197
197
}
198
198
}
199
199
200
- function getNextRouteFromPathname ( pathname : string ) : string | void {
200
+ function getNextRouteFromPathname ( pathname : string ) : string | undefined {
201
201
const pageRoutes = ( global . __BUILD_MANIFEST || { } ) . sortedPages ;
202
202
203
203
// Page route should in 99.999% of the cases be defined by now but just to be sure we make a check here
204
- if ( pageRoutes ) {
205
- return pageRoutes . find ( route => {
206
- const routeRegExp = convertNextRouteToRegExp ( route ) ;
207
- return pathname . match ( routeRegExp ) ;
208
- } ) ;
204
+ if ( ! pageRoutes ) {
205
+ return ;
209
206
}
207
+
208
+ return pageRoutes . find ( route => {
209
+ const routeRegExp = convertNextRouteToRegExp ( route ) ;
210
+ return pathname . match ( routeRegExp ) ;
211
+ } ) ;
210
212
}
211
213
212
214
/**
You can’t perform that action at this time.
0 commit comments