From f571b6ef5bddbbd16698aa049bb4ac8e21d8000a Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 10 Feb 2016 12:37:45 +0100 Subject: [PATCH] Verify Bytestream constructor arguments --- .../smackx/bytestreams/socks5/packet/Bytestream.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java index f23ed7ebe..df45488af 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java @@ -22,6 +22,8 @@ import java.util.List; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.NamedElement; +import org.jivesoftware.smack.util.Objects; +import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.XmlStringBuilder; import org.jxmpp.jid.Jid; @@ -283,8 +285,8 @@ public class Bytestream extends IQ { * @param address The internet address of the stream host. */ public StreamHost(final Jid JID, final String address, int port) { - this.JID = JID; - this.addy = address; + this.JID = Objects.requireNonNull(JID, "StreamHost JID must not be null"); + this.addy = StringUtils.requireNotNullOrEmpty(address, "StreamHost address must not be null"); this.port = port; }