1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-15 20:12:04 +01:00

Throw a NotConnectedException on disconnect()

if not connected. For consistent behavior, so that it is always
thrown. Previously it may be thrown or not.
This commit is contained in:
Florian Schmaus 2014-11-12 17:36:39 +01:00
parent 301519a264
commit 0db76f4eb1

View file

@ -596,7 +596,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
*/ */
public synchronized void disconnect(Presence unavailablePresence) throws NotConnectedException { public synchronized void disconnect(Presence unavailablePresence) throws NotConnectedException {
if (!isConnected()) { if (!isConnected()) {
return; throw new NotConnectedException();
} }
sendPacket(unavailablePresence); sendPacket(unavailablePresence);