fixed npe cause by race condition when axolotl service isn't initialized

This commit is contained in:
Daniel Gultsch 2016-12-23 21:19:38 +01:00
parent 28c64c2bd1
commit 9972f5eabc
1 changed files with 3 additions and 0 deletions

View File

@ -632,6 +632,9 @@ public class Account extends AbstractEntity {
if (otr != null) { if (otr != null) {
fingerprints.add(new XmppUri.Fingerprint(XmppUri.FingerprintType.OTR,otr)); 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())); fingerprints.add(new XmppUri.Fingerprint(XmppUri.FingerprintType.OMEMO,axolotlService.getOwnFingerprint().substring(2),axolotlService.getOwnDeviceId()));
for(XmppAxolotlSession session : axolotlService.findOwnSessions()) { for(XmppAxolotlSession session : axolotlService.findOwnSessions()) {
if (session.getTrust().isVerified() && session.getTrust().isActive()) { if (session.getTrust().isVerified() && session.getTrust().isActive()) {