Added a NPE check for trace web aspect

without this change if there's no tracing an NPE is thrown in TraceWebAspect

fixes #596
This commit is contained in:
Marcin Grzejszczak
2017-05-26 19:30:16 +02:00
parent 63c79033db
commit 802fbb63a6

View File

@@ -144,7 +144,7 @@ public class TraceWebAspect {
HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Throwable {
Span currentSpan = this.tracer.getCurrentSpan();
try {
if (!currentSpan.tags().containsKey(Span.SPAN_ERROR_TAG_NAME)) {
if (currentSpan != null && !currentSpan.tags().containsKey(Span.SPAN_ERROR_TAG_NAME)) {
this.tracer.addTag(Span.SPAN_ERROR_TAG_NAME, ExceptionUtils.getExceptionMessage(ex));
}
return pjp.proceed();