Commit 46d7393b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed NPE sorting users' presences. JM-134


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@893 b35dd754-fafc-0310-a699-88a17e54d16e
parent 5ec89f18
......@@ -242,8 +242,16 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
if (presence == null) {
presence = session.getPresence();
}
else if (presence.getShow().ordinal() > session.getPresence().getShow().ordinal()) {
presence = session.getPresence();
else {
// Get the ordinals of the presences to compare. If no ordinal is available then
// assume a value of -1
int o1 = presence.getShow() != null ? presence.getShow().ordinal() : -1;
int o2 = session.getPresence().getShow() != null ?
session.getPresence().getShow().ordinal() : -1;
// Compare the presences' show ordinals
if (o1 > o2) {
presence = session.getPresence();
}
}
}
return presence;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment