null check axolotl service when getting trust

This commit is contained in:
Daniel Gultsch 2022-04-08 15:55:16 +02:00
parent bf8afe0396
commit eb9f6653ad

View file

@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
import eu.siacs.conversations.crypto.axolotl.FingerprintStatus;
import eu.siacs.conversations.http.URL;
import eu.siacs.conversations.services.AvatarService;
@ -917,7 +918,8 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
}
public boolean isTrusted() {
FingerprintStatus s = conversation.getAccount().getAxolotlService().getFingerprintTrust(axolotlFingerprint);
final AxolotlService axolotlService = conversation.getAccount().getAxolotlService();
final FingerprintStatus s = axolotlService != null ? axolotlService.getFingerprintTrust(axolotlFingerprint) : null;
return s != null && s.isTrusted();
}