git » sdk » commit fd63db6

Don't crash if the nick is null somehow

author Stephen Paul Weber
2023-11-27 19:11:50 UTC
committer Stephen Paul Weber
2023-11-27 19:11:50 UTC
parent c1dfca2d8945adcabb509f06e9e97946fe109df2

Don't crash if the nick is null somehow

xmpp/Chat.hx +1 -1

diff --git a/xmpp/Chat.hx b/xmpp/Chat.hx
index 3cf4751..1b42a08 100644
--- a/xmpp/Chat.hx
+++ b/xmpp/Chat.hx
@@ -471,7 +471,7 @@ class Channel extends Chat {
 			});
 		} else {
 			final nick = JID.parse(participantId).resource;
-			final photoUri = Color.defaultPhoto(participantId, nick.charAt(0));
+			final photoUri = Color.defaultPhoto(participantId, nick == null ? " " : nick.charAt(0));
 			callback({ photoUri: photoUri, displayName: nick });
 		}
 	}