git » sdk » commit 4da4419

Guard against null channel disco

author Stephen Paul Weber
2024-12-10 19:00:40 UTC
committer Stephen Paul Weber
2024-12-10 19:00:40 UTC
parent c97bb320103b8119497df1bf210a42fdff7be885

Guard against null channel disco

snikket/Client.hx +1 -1

diff --git a/snikket/Client.hx b/snikket/Client.hx
index f274037..17a74e1 100644
--- a/snikket/Client.hx
+++ b/snikket/Client.hx
@@ -815,7 +815,7 @@ class Client extends EventEmitter {
 			if (chat.chatId != jid.asBare().asString()) {
 				if (chat.chatId.contains(query.toLowerCase()) || chat.getDisplayName().toLowerCase().contains(query.toLowerCase())) {
 					final channel = Util.downcast(chat, Channel);
-					results.push(new AvailableChat(chat.chatId, chat.getDisplayName(), chat.chatId, channel == null ? new Caps("", [], []) : channel.disco));
+					results.push(new AvailableChat(chat.chatId, chat.getDisplayName(), chat.chatId, channel == null || channel.disco == null ? new Caps("", [], []) : channel.disco));
 				}
 			}
 			if (chat.isTrusted()) {