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(
103
103
const browserTracingOptions = config . browserTracingOptions || config . sentry . browserTracingOptions || { } ;
104
104
const url = getLocationURL ( location ) ;
105
105
106
+ const client = Sentry . getClient < BrowserClient > ( ) ;
107
+
108
+ if ( ! client ) {
109
+ return ;
110
+ }
111
+
106
112
if ( url && browserTracingOptions . startTransactionOnPageLoad !== false ) {
107
113
const routeInfo = routerService . recognize ( url ) ;
108
- Sentry . startBrowserTracingPageLoadSpan ( {
114
+ Sentry . startBrowserTracingPageLoadSpan ( client , {
109
115
name : `route:${ routeInfo . name } ` ,
110
116
op : 'pageload' ,
111
117
origin : 'auto.pageload.ember' ,
@@ -134,7 +140,7 @@ export function _instrumentEmberRouter(
134
140
const { fromRoute, toRoute } = getTransitionInformation ( transition , routerService ) ;
135
141
activeRootSpan ?. end ( ) ;
136
142
137
- Sentry . startBrowserTracingNavigationSpan ( {
143
+ Sentry . startBrowserTracingNavigationSpan ( client , {
138
144
name : `route:${ toRoute } ` ,
139
145
op : 'navigation' ,
140
146
origin : 'auto.navigation.ember' ,
You can’t perform that action at this time.
0 commit comments