From 4f05255cfe326ed27f17620a3307d3241845e2d5 Mon Sep 17 00:00:00 2001 From: Thomas Pierce Date: Fri, 16 Aug 2024 16:35:03 -0700 Subject: [PATCH] Add nil checks (#234) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --- .../distro/attribute_propagating_span_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py index 61a36d0c1..6121723f8 100644 --- a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py @@ -66,9 +66,9 @@ def on_start(self, span: Span, parent_context: Optional[Context] = None) -> None if is_local_root(span): if not _is_server_kind(span): propagation_data = self._propagation_data_extractor(span) - elif _is_server_kind(parent_span): + elif parent_span and _is_server_kind(parent_span): propagation_data = self._propagation_data_extractor(parent_span) - else: + elif parent_span: propagation_data = parent_span.attributes.get(self._propagation_data_key) if propagation_data is not None: