mirror of
https://github.com/square/okhttp.git
synced 2026-01-14 07:22:20 +03:00
Merge pull request #4936 from TangHuaiZhe/dev2
Fix #4915 nullPointerException caused by realConnection is null
This commit is contained in:
@@ -229,8 +229,12 @@ public final class Http1ExchangeCodec implements ExchangeCodec {
|
||||
return responseBuilder;
|
||||
} catch (EOFException e) {
|
||||
// Provide more context if the server ends the stream before sending a response.
|
||||
String address = "unknown";
|
||||
if (realConnection != null) {
|
||||
address = realConnection.route().address().url().redact();
|
||||
}
|
||||
throw new IOException("unexpected end of stream on "
|
||||
+ realConnection.route().address().url().redact(), e);
|
||||
+ address, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user