commit | 4f611325d2afd7a3e5c5325be05103bb5a905d0e | [log] [tgz] |
---|---|---|
author | Narayan Kamath <narayan@google.com> | Tue Aug 12 15:52:04 2014 +0100 |
committer | The Android Automerger <android-build@google.com> | Tue Aug 12 10:25:02 2014 -0700 |
tree | 08392557d373f810d85a761499d4ba260ece2796 | |
parent | eea7b582a768673a31f7e62468138cc6c722a0a4 [diff] |
Fix NPE in Connection#close when socket == null. This is a partial cherry-pick of the upstream commit c26f9af0489869a9e1873ed5010c65f8464cff26. bug: 16907112 (cherry picked from commit c2bb00c4a14c9929d9126c39aeda4cb24576ef3e) Change-Id: I80e451ec1daf55b5ae5c3a76290cf48d5e3de559
diff --git a/okhttp/src/main/java/com/squareup/okhttp/Connection.java b/okhttp/src/main/java/com/squareup/okhttp/Connection.java index 39ca4d0..94527af 100644 --- a/okhttp/src/main/java/com/squareup/okhttp/Connection.java +++ b/okhttp/src/main/java/com/squareup/okhttp/Connection.java
@@ -225,7 +225,7 @@ } @Override public void close() throws IOException { - socket.close(); + if (socket != null) socket.close(); } /** Returns the route used by this connection. */