Fix runtime critical when room has no name

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

View file

@ -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;
}

View file

@ -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);
}