1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Verify Bytestream constructor arguments

This commit is contained in:
Florian Schmaus 2016-02-10 12:37:45 +01:00
parent 4fb3630896
commit f571b6ef5b

View file

@ -22,6 +22,8 @@ import java.util.List;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.NamedElement; 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.jivesoftware.smack.util.XmlStringBuilder;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
@ -283,8 +285,8 @@ public class Bytestream extends IQ {
* @param address The internet address of the stream host. * @param address The internet address of the stream host.
*/ */
public StreamHost(final Jid JID, final String address, int port) { public StreamHost(final Jid JID, final String address, int port) {
this.JID = JID; this.JID = Objects.requireNonNull(JID, "StreamHost JID must not be null");
this.addy = address; this.addy = StringUtils.requireNotNullOrEmpty(address, "StreamHost address must not be null");
this.port = port; this.port = port;
} }