From 9972f5eabc19e4afdd2c29cd9fa9957345089aab Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 23 Dec 2016 21:19:38 +0100 Subject: [PATCH] fixed npe cause by race condition when axolotl service isn't initialized --- src/main/java/eu/siacs/conversations/entities/Account.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index 024f5889a..5728c87b2 100644 --- a/src/main/java/eu/siacs/conversations/entities/Account.java +++ b/src/main/java/eu/siacs/conversations/entities/Account.java @@ -632,6 +632,9 @@ public class Account extends AbstractEntity { if (otr != null) { fingerprints.add(new XmppUri.Fingerprint(XmppUri.FingerprintType.OTR,otr)); } + if (axolotlService == null) { + return fingerprints; + } fingerprints.add(new XmppUri.Fingerprint(XmppUri.FingerprintType.OMEMO,axolotlService.getOwnFingerprint().substring(2),axolotlService.getOwnDeviceId())); for(XmppAxolotlSession session : axolotlService.findOwnSessions()) { if (session.getTrust().isVerified() && session.getTrust().isActive()) {