Fix a possible NPE in HiddenErrorHandler
From our server logs I observe that sporadically the HttpConnection.getCurrentConnection() returns null which causes a NPE in the HiddenErrorHandler.message method. Change-Id: Ib34ccf49482cd051d9c3609c3876cc4993ec6eb1
This commit is contained in:
committed by
David Pursehouse
parent
226abb7873
commit
1a004d3e3e
@@ -64,11 +64,16 @@ class HiddenErrorHandler extends ErrorHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] message(HttpConnection conn) {
|
private static byte[] message(HttpConnection conn) {
|
||||||
String msg = conn.getHttpChannel().getResponse().getReason();
|
String msg;
|
||||||
|
if (conn == null) {
|
||||||
|
msg = "";
|
||||||
|
} else {
|
||||||
|
msg = conn.getHttpChannel().getResponse().getReason();
|
||||||
if (msg == null) {
|
if (msg == null) {
|
||||||
msg = HttpStatus.getMessage(conn.getHttpChannel()
|
msg = HttpStatus.getMessage(conn.getHttpChannel()
|
||||||
.getResponse().getStatus());
|
.getResponse().getStatus());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return msg.getBytes(ISO_8859_1);
|
return msg.getBytes(ISO_8859_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user