From 87fb2df3eccc770395ea08559bc8b6c65977bdf7 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Tue, 20 Feb 2007 18:48:26 +0000 Subject: [PATCH] Check that roster is not null when disconnecting (fixed NPE). git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7221 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/XMPPConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;