diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index 4cb340f8d..e6d56daff 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -545,6 +545,9 @@ public class XMPPConnection { if (!isConnected()) { throw new IllegalStateException("Not connected to server."); } + if (packet == null) { + throw new NullPointerException("Packet is null."); + } packetWriter.sendPacket(packet); }