Skip to content

Commit

Permalink
Silently ignore 'bio == null' NullPointerExceptions (#6534)
Browse files Browse the repository at this point in the history
Closes: #6509
  • Loading branch information
swankjesse committed Jan 30, 2021
1 parent cbeaf8f commit d2e28ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions okhttp/src/main/kotlin/okhttp3/internal/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ fun Socket.closeQuietly() {
} catch (e: AssertionError) {
throw e
} catch (rethrown: RuntimeException) {
if (rethrown.message == "bio == null") {
// 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) {
}
Expand Down

0 comments on commit d2e28ab

Please sign in to comment.