Handle null span in LazyTracingSpanContextSupplier consistently

See gh-32817
This commit is contained in:
Johnny Lim 2022-10-20 20:10:51 +09:00 committed by Andy Wilkinson
parent 67e4ac4f1e
commit 8d17d2d443
1 changed files with 4 additions and 2 deletions

View File

@ -67,12 +67,14 @@ public class ExemplarsAutoConfiguration {
@Override
public String getTraceId() {
return currentSpan().context().traceId();
Span currentSpan = currentSpan();
return (currentSpan != null) ? currentSpan.context().traceId() : null;
}
@Override
public String getSpanId() {
return currentSpan().context().spanId();
Span currentSpan = currentSpan();
return (currentSpan != null) ? currentSpan.context().spanId() : null;
}
@Override