From 57ab387060c3b7ae05860fad2239dedf2e5804a4 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 29 Oct 2020 19:11:55 +0100 Subject: [PATCH] Fix runtime critical when room has no name --- main/src/ui/util/helper.vala | 2 +- xmpp-vala/src/module/xep/0045_muc/module.vala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala index ffc35703..b0a2bf28 100644 --- a/main/src/ui/util/helper.vala +++ b/main/src/ui/util/helper.vala @@ -161,7 +161,7 @@ private static string? get_real_display_name(StreamInteractor stream_interactor, private static string get_groupchat_display_name(StreamInteractor stream_interactor, Account account, Jid jid) { MucManager muc_manager = stream_interactor.get_module(MucManager.IDENTITY); - string room_name = muc_manager.get_room_name(account, jid); + string? room_name = muc_manager.get_room_name(account, jid); if (room_name != null && room_name != jid.localpart) { return room_name; } diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala index 79fd2c31..1c58ab67 100644 --- a/xmpp-vala/src/module/xep/0045_muc/module.vala +++ b/xmpp-vala/src/module/xep/0045_muc/module.vala @@ -383,7 +383,7 @@ public class Module : XmppStreamModule { if (query_result != null) { foreach (ServiceDiscovery.Identity identity in query_result.identities) { - if (identity.category == "conference") { + if (identity.category == "conference" && identity.name != null) { stream.get_flag(Flag.IDENTITY).set_room_name(jid, identity.name); room_name_set(stream, jid, identity.name); }