Skip to content

Commit e339265

Browse files
author
Peter Giacomo Lombardo
authored
OpenTracing Baggage: Add safety against alien context types (#291)
1 parent 2ffbc80 commit e339265

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

instana/tracer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def start_span(self,
8282
gid = generate_id()
8383
ctx = SpanContext(span_id=gid)
8484
if parent_ctx is not None and parent_ctx.trace_id is not None:
85-
if parent_ctx._baggage is not None:
85+
if hasattr(parent_ctx, '_baggage') and parent_ctx._baggage is not None:
8686
ctx._baggage = parent_ctx._baggage.copy()
8787
ctx.trace_id = parent_ctx.trace_id
8888
ctx.sampled = parent_ctx.sampled

0 commit comments

Comments
 (0)