Fix deleting a recipient which has no uuid

Fixes #946
This commit is contained in:
AsamK 2022-05-02 17:13:30 +02:00
parent 275be59c25
commit 5837a6982b

View file

@ -279,11 +279,13 @@ public class RecipientStore implements RecipientResolver, ContactsStore, Profile
synchronized (recipients) {
logger.debug("Deleting recipient data for {}", recipientId);
final var recipient = recipients.get(recipientId);
storeRecipientLocked(recipientId,
recipient.getAddress()
.uuid()
.ifPresent(uuid -> storeRecipientLocked(recipientId,
Recipient.newBuilder()
.withRecipientId(recipientId)
.withAddress(new RecipientAddress(recipient.getAddress().uuid().orElse(null)))
.build());
.withAddress(new RecipientAddress(uuid))
.build()));
}
}