diff --git a/okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/platform/Platform.kt b/okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/platform/Platform.kt index f33d97972b94..9ccde5c61b0a 100644 --- a/okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/platform/Platform.kt +++ b/okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/platform/Platform.kt @@ -132,7 +132,7 @@ open class Platform { open fun getHandshakeServerNames(sslSocket: SSLSocket): List { val session = sslSocket.session as? ExtendedSSLSession ?: return listOf() return try { - session.requestedServerNames.mapNotNull { (it as? SNIHostName)?.asciiName } + (session.requestedServerNames ?: emptyList()).mapNotNull { (it as? SNIHostName)?.asciiName } } catch (_: UnsupportedOperationException) { // UnsupportedOperationException – if the underlying provider does not implement the operation // https://github.com/bcgit/bc-java/issues/1773