From 4a769b026262dd24aee8a81036abf9e6515fad2b Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 30 Jan 2015 09:37:55 +0100 Subject: [PATCH] Throw IAE in IQReplyFilter if there is no local JID available yet. --- .../java/org/jivesoftware/smack/filter/IQReplyFilter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java index 703c40b68..efc008744 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java @@ -89,7 +89,11 @@ public class IQReplyFilter implements PacketFilter { } else { to = null; } - local = conn.getUser().toLowerCase(Locale.US); + final String localJid = conn.getUser(); + if (localJid == null) { + throw new IllegalArgumentException("Must have a local (user) JID set. Either you didn't configure one or you where not connected at least once"); + } + local = localJid.toLowerCase(Locale.US); server = conn.getServiceName().toLowerCase(Locale.US); packetId = iqPacket.getPacketID();