Fix incorrect handling of decryptedEntries size

This commit is contained in:
chimp1984 2020-10-07 18:16:34 -05:00
parent 983f610e73
commit 31e7e26557
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -450,10 +450,12 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
}
private void processSingleMailboxEntry(Collection<ProtectedMailboxStorageEntry> protectedMailboxStorageEntries) {
checkArgument(protectedMailboxStorageEntries.size() == 1);
var decryptedEntries = new ArrayList<>(getDecryptedEntries(protectedMailboxStorageEntries));
checkArgument(decryptedEntries.size() == 1);
if (protectedMailboxStorageEntries.size() == 1) {
storeMailboxDataAndNotifyListeners(decryptedEntries.get(0));
}
}
// We run the batch processing of all mailbox messages we have received at startup in a thread to not block the UI.
// For about 1000 messages decryption takes about 1 sec.