diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java index 2d1956fe..4092bd79 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java @@ -424,6 +424,9 @@ public class SignalAccount implements Closeable { public void removeRecipient(final RecipientId recipientId) { final var recipientAddress = getRecipientStore().resolveRecipientAddress(recipientId); + if (recipientAddress.matches(getSelfRecipientAddress())) { + throw new RuntimeException("Can't delete self recipient"); + } getRecipientStore().deleteRecipientData(recipientId); getMessageCache().deleteMessages(recipientId); if (recipientAddress.serviceId().isPresent()) {