From 5038db063ec3981385dd68a3069e8edd0b52075d Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 15 Mar 2017 17:23:13 +0100 Subject: omemo plugin: improve session bootstrapping --- libdino/src/service/muc_manager.vala | 3 ++- libdino/src/service/presence_manager.vala | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'libdino') diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 589f26d7..17a6d975 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -130,7 +130,8 @@ public class MucManager : StreamInteractionModule, Object { public string? get_nick(Jid jid, Account account) { Core.XmppStream? stream = stream_interactor.get_stream(account); if (stream != null) { - return Xep.Muc.Flag.get_flag(stream).get_muc_nick(jid.bare_jid.to_string()); + Xep.Muc.Flag? flag = Xep.Muc.Flag.get_flag(stream); + if (flag != null) return flag.get_muc_nick(jid.bare_jid.to_string()); } return null; } diff --git a/libdino/src/service/presence_manager.vala b/libdino/src/service/presence_manager.vala index 6a8d77aa..7ff74e1a 100644 --- a/libdino/src/service/presence_manager.vala +++ b/libdino/src/service/presence_manager.vala @@ -42,7 +42,9 @@ public class PresenceManager : StreamInteractionModule, Object { public ArrayList? get_full_jids(Jid jid, Account account) { Core.XmppStream? stream = stream_interactor.get_stream(account); if (stream != null) { - Gee.List resources = Xmpp.Presence.Flag.get_flag(stream).get_resources(jid.bare_jid.to_string()); + Xmpp.Presence.Flag flag = Xmpp.Presence.Flag.get_flag(stream); + if (flag == null) return null; + Gee.List resources = flag.get_resources(jid.bare_jid.to_string()); if (resources == null) { return null; } -- cgit v1.2.3-70-g09d2