diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-09-05 18:47:37 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-09-05 18:47:37 +0200 |
commit | 2c4a6b09127c8e6776020cd90c782ab950a70324 (patch) | |
tree | b073b612daff3c020134e72ecf19a40d3a5b892a /src | |
parent | e2d506c96a0a72b7a903d28d9b3a858430700266 (diff) |
add null pointer check to db migration
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java | 6 |
1 files changed, 5 insertions, 1 deletions
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"); + } } } } |