Skip to content

Commit

Permalink
Fix possible AttributeError
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Sep 13, 2019
1 parent c3b6db9 commit 3ced2ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async def _receive(self, timeout_time=None, max_batch_size=None, **kwargs):
# Tracing
current_span = get_parent_span()
if current_span and event_data.application_properties:
traceparent = event_data.application_properties.get(b"Diagnostic-Id", None).decode('ascii')
traceparent = event_data.application_properties.get(b"Diagnostic-Id", "").decode('ascii')
if traceparent:
current_span.link(traceparent)

Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/azure-eventhubs/azure/eventhub/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _receive(self, timeout_time=None, max_batch_size=None, **kwargs):
# Tracing
current_span = get_parent_span()
if current_span and event_data.application_properties:
traceparent = event_data.application_properties.get(b"Diagnostic-Id", None).decode('ascii')
traceparent = event_data.application_properties.get(b"Diagnostic-Id", "").decode('ascii')
if traceparent:
current_span.link(traceparent)

Expand Down

0 comments on commit 3ced2ce

Please sign in to comment.