Skip to content

Commit

Permalink
resolving Null issue of span
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianlin-Zhao committed Aug 20, 2020
1 parent 8ac9486 commit af1b484
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ class HttpTraceContext : public HTTPTextFormat<T>
const nostd::string_view span_key = "current-span";
context::Context ctx(context);
context::ContextValue span = ctx.GetValue(span_key);
if (nostd::get<int>(span) == 0)
if (nostd::holds_alternative<nostd::shared_ptr<Span>>(span))
{
return;
span_context = nostd::get<nostd::shared_ptr<Span>>(span).get().GetContext();
}
span_context = nostd::get<nostd::shared_ptr<Span>>(span).get().GetContext();
}

static TraceId GenerateTraceIdFromString(nostd::string_view trace_id)
Expand Down

0 comments on commit af1b484

Please sign in to comment.