aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/session_store.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-04-18 17:55:20 +0200
committerMarvin W <git@larma.de>2017-04-18 20:20:41 +0200
commit7e388fb2bc784568734592dcb2e863dfa061bed4 (patch)
treeeb4fb804fd7cf9df02b39d37b61937f355785810 /plugins/omemo/src/session_store.vala
parentf95b4f4e0949eefaed871c267626e3ff84ce5ca6 (diff)
downloaddino-7e388fb2bc784568734592dcb2e863dfa061bed4.tar.gz
dino-7e388fb2bc784568734592dcb2e863dfa061bed4.zip
signal-protocol/omemo: fix null-pointer issues
Fixes #44 and #58
Diffstat (limited to 'plugins/omemo/src/session_store.vala')
-rw-r--r--plugins/omemo/src/session_store.vala5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/omemo/src/session_store.vala b/plugins/omemo/src/session_store.vala
index f70e16ea..333fdc08 100644
--- a/plugins/omemo/src/session_store.vala
+++ b/plugins/omemo/src/session_store.vala
@@ -15,11 +15,10 @@ private class BackedSessionStore : SimpleSessionStore {
private void init() {
try {
- Address addr = new Address();
foreach (Row row in db.session.select().with(db.session.identity_id, "=", identity_id)) {
- addr.name = row[db.session.address_name];
- addr.device_id = row[db.session.device_id];
+ Address addr = new Address(row[db.session.address_name], row[db.session.device_id]);
store_session(addr, Base64.decode(row[db.session.record_base64]));
+ addr.device_id = 0;
}
} catch (Error e) {
print(@"OMEMO: Error while initializing session store: $(e.message)\n");