diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index b45d5d57f..829823153 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -633,8 +633,10 @@ public class XMPPConnection { public void disconnect(Presence unavailablePresence) { shutdown(unavailablePresence); - roster.cleanup(); - roster = null; + if (roster != null) { + roster.cleanup(); + roster = null; + } wasAuthenticated = false;