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
1 changed files with 1 additions and 1 deletions

View File

@ -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);