fix: handle pendingKeyPair.getOrElse nullable after checking if key exists

pull/441/head
Jubb 4 years ago
parent 93f7d428cb
commit 8476e090e2

@ -548,9 +548,8 @@ object ClosedGroupsProtocolV2 {
} }
if (userPublicKey in admins) { if (userPublicKey in admins) {
// send current encryption key to the latest added members // send current encryption key to the latest added members
val encryptionKeyPair = pendingKeyPair.getOrElse(groupPublicKey) { val encryptionKeyPair = pendingKeyPair[groupPublicKey]?.orNull()
Optional.fromNullable(apiDB.getLatestClosedGroupEncryptionKeyPair(groupPublicKey)) ?: apiDB.getLatestClosedGroupEncryptionKeyPair(groupPublicKey)
}.orNull()
if (encryptionKeyPair == null) { if (encryptionKeyPair == null) {
Log.d("Loki", "Couldn't get encryption key pair for closed group.") Log.d("Loki", "Couldn't get encryption key pair for closed group.")
} else { } else {

Loading…
Cancel
Save