diff --git a/source/org/jivesoftware/smack/Roster.java b/source/org/jivesoftware/smack/Roster.java index e8d5b95f8..dd30dfa12 100644 --- a/source/org/jivesoftware/smack/Roster.java +++ b/source/org/jivesoftware/smack/Roster.java @@ -488,7 +488,13 @@ public class Roster implements ConnectionListener { return new Presence(Presence.Type.unavailable); } else { - return userPresences.get(resource); + Presence presence = userPresences.get(resource); + if (presence == null) { + return new Presence(Presence.Type.unavailable); + } + else { + return presence; + } } }