File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/tracing/src/browser Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -217,15 +217,16 @@ export function xhrCallback(
217217
218218 // check first if the request has finished and is tracked by an existing span which should now end
219219 if ( handlerData . endTimestamp ) {
220- if ( ! handlerData . xhr . __sentry_xhr_span_id__ ) return ;
220+ const spanId = handlerData . xhr . __sentry_xhr_span_id__ ;
221+ if ( ! spanId ) return ;
221222
222- const span = spans [ handlerData . xhr . __sentry_xhr_span_id__ ] ;
223+ const span = spans [ spanId ] ;
223224 if ( span ) {
224225 span . setHttpStatus ( xhr . status_code ) ;
225226 span . finish ( ) ;
226227
227228 // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
228- delete spans [ handlerData . xhr . __sentry_xhr_span_id__ ] ;
229+ delete spans [ spanId ] ;
229230 }
230231 return ;
231232 }
You can’t perform that action at this time.
0 commit comments