Skip to content

Commit

Permalink
fix(utils): Fix XHR instrumentation early return (#9770)
Browse files Browse the repository at this point in the history
This was introduced in
#9542 😬

Ideally we could have a lint rule for this, but probably this is rather
hard to do - so reminder to self to keep an eye out for this in the
future!

Closes #9747
  • Loading branch information
mydea committed Dec 7, 2023
1 parent 4ce3845 commit da73a7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/src/instrument/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function instrumentXHR(): void {
const url = parseUrl(args[1]);

if (!method || !url) {
return;
return originalOpen.apply(this, args);
}

this[SENTRY_XHR_DATA_KEY] = {
Expand Down Expand Up @@ -124,7 +124,7 @@ export function instrumentXHR(): void {
const sentryXhrData = this[SENTRY_XHR_DATA_KEY];

if (!sentryXhrData) {
return;
return originalSend.apply(this, args);
}

if (args[0] !== undefined) {
Expand Down

0 comments on commit da73a7a

Please sign in to comment.