From 0db76f4eb1710da0cbb8f91a5574030fb724a133 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 12 Nov 2014 17:36:39 +0100 Subject: [PATCH] Throw a NotConnectedException on disconnect() if not connected. For consistent behavior, so that it is always thrown. Previously it may be thrown or not. --- .../java/org/jivesoftware/smack/AbstractXMPPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index e506b213e..4965a2724 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -596,7 +596,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { */ public synchronized void disconnect(Presence unavailablePresence) throws NotConnectedException { if (!isConnected()) { - return; + throw new NotConnectedException(); } sendPacket(unavailablePresence);