Skip to content

Commit 71fe56a

Browse files
committed
try/catch instead of definedness guarding
1 parent 4575321 commit 71fe56a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/core/src/sdk.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export function setCurrentClient(client: Client): void {
5454
* @see {@link ./asyncContext/stackStrategy.ts getAsyncContextStack}
5555
*/
5656
function registerClientOnGlobalHub(client: Client): void {
57-
const sentryGlobal = getSentryCarrier(getMainCarrier());
5857
try {
59-
sentryGlobal.stack.getStackTop().client = client;
60-
} catch {
61-
// ignore errors here
62-
}
58+
// @ts-expect-error - purposefully not guarding the call here but try/catching for bundle size efficiency
59+
getSentryCarrier(getMainCarrier()).stack.getStackTop().client = client;
60+
} catch {
61+
// ignore errors here
62+
}
6363
}

0 commit comments

Comments
 (0)