diff --git a/lib/encryption/utils/key_verification.dart b/lib/encryption/utils/key_verification.dart index 5e6fa75f..03f32ffd 100644 --- a/lib/encryption/utils/key_verification.dart +++ b/lib/encryption/utils/key_verification.dart @@ -938,13 +938,14 @@ class KeyVerification { '[Key Verification] Tried to broadcast and un-broadcastable type: $type'); } } else { - if (client.userDeviceKeys[userId]?.deviceKeys[deviceId] == null) { + if (client.userDeviceKeys[userId]?.deviceKeys[deviceId] != null) { + await client.sendToDeviceEncrypted( + [client.userDeviceKeys[userId]!.deviceKeys[deviceId]!], + type, + payload); + } else { Logs().e('[Key Verification] Unknown device'); } - await client.sendToDeviceEncrypted( - [client.userDeviceKeys[userId]!.deviceKeys[deviceId]!], - type, - payload); } } }