mirror of
https://github.com/nikdoof/bukkitxmpp.git
synced 2025-12-14 10:02: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() {
|
private void disconnect() {
|
||||||
|
|
||||||
if (muc instanceof MultiUserChat) {
|
if (muc instanceof MultiUserChat && muc.isJoined()) {
|
||||||
muc.leave();
|
muc.leave();
|
||||||
muc = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xmppconn instanceof XMPPConnection) {
|
if (xmppconn instanceof XMPPConnection && xmppconn.isConnected()) {
|
||||||
xmppconn.disconnect();
|
xmppconn.disconnect();
|
||||||
xmppconn = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user