diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/cryptor/ECDHJvm.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/cryptor/ECDHJvm.kt index eb1e51a17..6cb1c5ce5 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/cryptor/ECDHJvm.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/cryptor/ECDHJvm.kt @@ -47,7 +47,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) { if (kotlin.runCatching { Security.addProvider(BouncyCastleProvider()) generateKeyPair() // try if it is working - }.exceptionOrNull() == null) { + }.isSuccess) { isECDHAvailable = true } }