mirror of
https://github.com/nikdoof/bukkitxmpp.git
synced 2025-12-13 17:42:16 +00:00
Only attempt to leave/disconnect if actually in the channel/connected.
This commit is contained in:
@@ -117,14 +117,12 @@ public class BukkitXMPP extends JavaPlugin implements PacketListener {
|
||||
|
||||
private void disconnect() {
|
||||
|
||||
if (muc instanceof MultiUserChat) {
|
||||
if (muc instanceof MultiUserChat && muc.isJoined()) {
|
||||
muc.leave();
|
||||
muc = null;
|
||||
}
|
||||
|
||||
if (xmppconn instanceof XMPPConnection) {
|
||||
if (xmppconn instanceof XMPPConnection && xmppconn.isConnected()) {
|
||||
xmppconn.disconnect();
|
||||
xmppconn = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user