Skip to content

Commit 495dbd7

Browse files
committed
small ref
1 parent 6b7d131 commit 495dbd7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/core/src/baseclient.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -986,13 +986,15 @@ function processBeforeSend(
986986
}
987987

988988
if (beforeSendTransaction) {
989-
// We store the # of spans before processing in SDK metadata,
990-
// so we can compare it afterwards to determine how many spans were dropped
991-
const spanCountBefore = event.spans ? event.spans.length : 0;
992-
event.sdkProcessingMetadata = {
993-
...event.sdkProcessingMetadata,
994-
spanCountBeforeProcessing: spanCountBefore,
995-
};
989+
if (event.spans) {
990+
// We store the # of spans before processing in SDK metadata,
991+
// so we can compare it afterwards to determine how many spans were dropped
992+
const spanCountBefore = event.spans.length;
993+
event.sdkProcessingMetadata = {
994+
...event.sdkProcessingMetadata,
995+
spanCountBeforeProcessing: spanCountBefore,
996+
};
997+
}
996998
return beforeSendTransaction(event, hint);
997999
}
9981000
}

0 commit comments

Comments
 (0)