diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java index 5e4dd77d..e13c02e4 100644 --- a/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java +++ b/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java @@ -142,12 +142,13 @@ public class UnidentifiedAccessHelper { public Optional getAccessFor(RecipientId recipient) { var recipientUnidentifiedAccessKey = getTargetUnidentifiedAccessKey(recipient); + if (recipientUnidentifiedAccessKey == null) { + return Optional.absent(); + } + var selfUnidentifiedAccessKey = getSelfUnidentifiedAccessKey(); var selfUnidentifiedAccessCertificate = getSenderCertificateFor(recipient); - - if (recipientUnidentifiedAccessKey == null - || selfUnidentifiedAccessKey == null - || selfUnidentifiedAccessCertificate == null) { + if (selfUnidentifiedAccessKey == null || selfUnidentifiedAccessCertificate == null) { return Optional.absent(); }