Fix runtime critical when room has no name

This commit is contained in:
fiaxh 2020-10-29 19:11:55 +01:00
parent b685c7ab9e
commit dba63b1473
2 changed files with 2 additions and 2 deletions

View file

@ -162,7 +162,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) { private static string get_groupchat_display_name(StreamInteractor stream_interactor, Account account, Jid jid) {
MucManager muc_manager = stream_interactor.get_module(MucManager.IDENTITY); 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) { if (room_name != null && room_name != jid.localpart) {
return room_name; return room_name;
} }

View file

@ -407,7 +407,7 @@ public class Module : XmppStreamModule {
Gee.List<Feature> features = new ArrayList<Feature>(); Gee.List<Feature> features = new ArrayList<Feature>();
foreach (ServiceDiscovery.Identity identity in info_result.identities) { foreach (ServiceDiscovery.Identity identity in info_result.identities) {
if (identity.category == "conference") { if (identity.category == "conference" && identity.name != null) {
stream.get_flag(Flag.IDENTITY).set_room_name(jid, identity.name); stream.get_flag(Flag.IDENTITY).set_room_name(jid, identity.name);
} }
} }