From 888de7e1c1d3e01c06120121d6c15743cb86625c Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 16 Oct 2014 13:02:06 +0200 Subject: [PATCH] Remove nullOrEmpty check for setSessionID() in AdHocCommandData. This check was added in 3a37b71e193729a9714a9793fb444be513b774fc, but a session ID can be null, if it's the first invocation. This prevented RemoteCommand.execute() from executing, since RemoteCommand's sessionID member will be null at the first invocation. --- .../smackx/commands/packet/AdHocCommandData.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java index a359538ab..332625f47 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java @@ -19,7 +19,6 @@ package org.jivesoftware.smackx.commands.packet; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.PacketExtension; -import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.XmlStringBuilder; import org.jivesoftware.smackx.commands.AdHocCommand; import org.jivesoftware.smackx.commands.AdHocCommand.Action; @@ -224,10 +223,16 @@ public class AdHocCommandData extends IQ { return executeAction; } + /** + * Set the 'sessionid' attribute of the command. + *

+ * This value can be null or empty for the first command, but MUST be set for subsequent commands. See also XEP-0050 ยง 3.3 Session Lifetime. + *

+ * + * @param sessionID + */ public void setSessionID(String sessionID) { - if (StringUtils.isNullOrEmpty(sessionID)) { - throw new IllegalArgumentException("session id must not be null or empty"); - } this.sessionID = sessionID; }