Skip to content

Commit

Permalink
Silently ignore 'bio == null' NullPointerExceptions (#6535)
Browse files Browse the repository at this point in the history
Closes: #6509
  • Loading branch information
swankjesse authored Jan 30, 2021
1 parent 46de1ff commit 00c4c8e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions okhttp/src/main/java/okhttp3/internal/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public static void closeQuietly(Socket socket) {
} catch (AssertionError e) {
if (!isAndroidGetsocknameError(e)) throw e;
} catch (RuntimeException rethrown) {
if ("bio == null".equals(rethrown.getMessage())) {
// Conscrypt in Android 10 and 11 may throw closing an SSLSocket. This is safe to ignore.
// https://issuetracker.google.com/issues/177450597
return;
}
throw rethrown;
} catch (Exception ignored) {
}
Expand Down

0 comments on commit 00c4c8e

Please sign in to comment.