File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/ember/addon/instance-initializers Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,15 @@ export function _instrumentEmberRouter(
103103 const browserTracingOptions = config . browserTracingOptions || config . sentry . browserTracingOptions || { } ;
104104 const url = getLocationURL ( location ) ;
105105
106+ const client = Sentry . getClient < BrowserClient > ( ) ;
107+
108+ if ( ! client ) {
109+ return ;
110+ }
111+
106112 if ( url && browserTracingOptions . startTransactionOnPageLoad !== false ) {
107113 const routeInfo = routerService . recognize ( url ) ;
108- Sentry . startBrowserTracingPageLoadSpan ( {
114+ Sentry . startBrowserTracingPageLoadSpan ( client , {
109115 name : `route:${ routeInfo . name } ` ,
110116 op : 'pageload' ,
111117 origin : 'auto.pageload.ember' ,
@@ -134,7 +140,7 @@ export function _instrumentEmberRouter(
134140 const { fromRoute, toRoute } = getTransitionInformation ( transition , routerService ) ;
135141 activeRootSpan ?. end ( ) ;
136142
137- Sentry . startBrowserTracingNavigationSpan ( {
143+ Sentry . startBrowserTracingNavigationSpan ( client , {
138144 name : `route:${ toRoute } ` ,
139145 op : 'navigation' ,
140146 origin : 'auto.navigation.ember' ,
You can’t perform that action at this time.
0 commit comments