From 613da7b9ff63198562a7d817c5fe82f69e6a4fbe Mon Sep 17 00:00:00 2001 From: Daniele Ricci Date: Tue, 12 Aug 2014 19:15:01 +0200 Subject: [PATCH] Allow null username (mainly for SASL EXTERNAL) Signed-off-by: Daniele Ricci --- .../java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index f29c8bcf1..1bca84067 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -254,7 +254,9 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { throw new AlreadyLoggedInException(); } // Do partial version of nameprep on the username. - username = username.toLowerCase(Locale.US).trim(); + if (username != null) { + username = username.toLowerCase(Locale.US).trim(); + } if (saslAuthentication.hasNonAnonymousAuthentication()) { // Authenticate using SASL