From 2c4a6b09127c8e6776020cd90c782ab950a70324 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 5 Sep 2015 18:47:37 +0200 Subject: [PATCH] add null pointer check to db migration --- .../eu/siacs/conversations/persistance/DatabaseBackend.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 44063a54..d420c1cd 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -312,7 +312,11 @@ public class DatabaseBackend extends SQLiteOpenHelper { AxolotlAddress ownAddress = new AxolotlAddress(account.getJid().toBareJid().toString(), ownDeviceId); deleteSession(db, account, ownAddress); IdentityKeyPair identityKeyPair = loadOwnIdentityKeyPair(db, account); - setIdentityKeyTrust(db, account, identityKeyPair.getPublicKey().getFingerprint().replaceAll("\\s", ""), XmppAxolotlSession.Trust.TRUSTED ); + if (identityKeyPair != null) { + setIdentityKeyTrust(db, account, identityKeyPair.getPublicKey().getFingerprint().replaceAll("\\s", ""), XmppAxolotlSession.Trust.TRUSTED); + } else { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": could not load own identity key pair"); + } } } }