Fixes potential NPE; fixes gh-1072

This commit is contained in:
Marcin Grzejszczak
2018-08-24 10:18:02 +02:00
parent f33dff142e
commit 04679721b7

View File

@@ -403,9 +403,11 @@ class TracingHttpClientInstrumentation {
return responseMono.doOnSuccessOrError((httpClientResponse, throwable) -> {
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.get())) {
// status codes and CR
this.handler.handleReceive(httpClientResponse, throwable, span.get());
if (log.isDebugEnabled()) {
log.debug("Setting client sent spans");
if (span.get() != null) {
this.handler.handleReceive(httpClientResponse, throwable, span.get());
if (log.isDebugEnabled()) {
log.debug("Setting client sent spans");
}
}
}
});