Disallow null or empty string in PubSubManager.getNode(String)

This commit is contained in:
Florian Schmaus 2019-06-12 22:31:55 +02:00
parent ef88bb17d0
commit a3f6fa65a4
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ import org.jivesoftware.smack.packet.IQ.Type;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.StanzaError;
import org.jivesoftware.smack.packet.StanzaError.Condition;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
@ -268,6 +269,7 @@ public final class PubSubManager extends Manager {
* @throws NotAPubSubNodeException
*/
public Node getNode(String id) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotAPubSubNodeException {
StringUtils.requireNotNullNorEmpty(id, "The node ID can not be null or the empty string");
Node node = nodeMap.get(id);
if (node == null) {