1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 03:52:06 +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.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;
}