Skip to content

Commit

Permalink
open-telemetry#894: further null-check improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rypdal committed Aug 8, 2023
1 parent 490f16b commit 556bd8a
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ internal static PropagationContext ExtractParentContext(SQSEvent.SQSMessage sqsM
// SQS subscribed to SNS topic with raw delivery disabled case, i.e. SNS record serialized into SQS body.
// https://docs.aws.amazon.com/sns/latest/dg/sns-large-payload-raw-message-delivery.html
SNSEvent.SNSMessage? snsMessage = GetSnsMessage(sqsMessage);
if (snsMessage != null)
{
parentContext = ExtractParentContext(snsMessage);
}
parentContext = ExtractParentContext(snsMessage);
}

return parentContext;
Expand All @@ -99,7 +96,7 @@ internal static PropagationContext ExtractParentContext(SNSEvent.SNSRecord? reco
default;
}

internal static PropagationContext ExtractParentContext(SNSEvent.SNSMessage message)
internal static PropagationContext ExtractParentContext(SNSEvent.SNSMessage? message)
{
return (message?.MessageAttributes != null) ?
Propagators.DefaultTextMapPropagator.Extract(default, message.MessageAttributes, SnsMessageAttributeGetter) :
Expand Down

0 comments on commit 556bd8a

Please sign in to comment.