Fixed potential NPEs

This commit is contained in:
Marcin Grzejszczak
2018-03-05 10:23:44 +01:00
parent 2f2b54c103
commit 37a6763a44

View File

@@ -65,7 +65,11 @@ class SleuthHttpServerParser extends HttpServerParser {
error(null, error, customizer);
return;
}
int httpStatus = adapter.statusCode(res);
Integer httpStatus = adapter.statusCode(res);
if (httpStatus == null) {
error(httpStatus, error, customizer);
return;
}
if (httpStatus == HttpServletResponse.SC_OK && error != null) {
// Filter chain threw exception but the response status may not have been set
// yet, so we have to guess.