Skip to content

Commit 9c23202

Browse files
committed
wip
1 parent 50aae2a commit 9c23202

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Tracing/PropagationContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ private static function parseTraceparentAndBaggage(string $traceparent, string $
193193
$client = SentrySdk::getCurrentHub()->getClient();
194194
if ($client !== null) {
195195
$options = $client->getOptions();
196-
$orgId = $options->getOrgId() ?? $options->getDsn()->getOrgId();
196+
$orgId = $options->getOrgId() ?? ($options->getDsn() !== null) ? $options->getDsn()->getOrgId() : null;
197197

198198
// Always check if the received org ID in the baggages matches
199199
// the one configured in the SDK.
200200
if (
201-
$orgId !== null &&
202-
$samplingContext->has('org_id') &&
203-
$samplingContext->get('org_id') !== (string) $orgId
201+
$orgId !== null
202+
&& $samplingContext->has('org_id')
203+
&& $samplingContext->get('org_id') !== (string) $orgId
204204
) {
205205
// We do not continue the trace.
206206
return $context;

src/Tracing/TransactionContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ private static function parseTraceAndBaggage(string $sentryTrace, string $baggag
155155
$client = SentrySdk::getCurrentHub()->getClient();
156156
if ($client !== null) {
157157
$options = $client->getOptions();
158-
$orgId = $options->getOrgId() ?? $options->getDsn()->getOrgId();
158+
$orgId = $options->getOrgId() ?? ($options->getDsn() !== null) ? $options->getDsn()->getOrgId() : null;
159159

160160
// Always check if the received org ID in the baggages matches
161161
// the one configured in the SDK.
162162
if (
163-
$orgId !== null &&
164-
$samplingContext->has('org_id') &&
165-
$samplingContext->get('org_id') !== (string) $orgId
163+
$orgId !== null
164+
&& $samplingContext->has('org_id')
165+
&& $samplingContext->get('org_id') !== (string) $orgId
166166
) {
167167
// We do not continue the trace.
168168
return $context;

0 commit comments

Comments
 (0)