Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit dcdb113

Browse files
authored
fix: Check if captureRequestSession is available before its called (getsentry#3773)
* Check the presence of _captureRequestSession before calling it
1 parent e06b502 commit dcdb113

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/node/src/handlers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ export function requestHandler(
433433
const client = currentHub.getClient<NodeClient>();
434434
if (isAutoSessionTrackingEnabled(client)) {
435435
setImmediate(() => {
436-
if (client) {
436+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
437+
if (client && (client as any)._captureRequestSession) {
437438
// Calling _captureRequestSession to capture request session at the end of the request by incrementing
438439
// the correct SessionAggregates bucket i.e. crashed, errored or exited
439440
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access

0 commit comments

Comments
 (0)