Commit 3baf1d09 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Added sanity check for shared groups with no displayName.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1563 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3bbbd5fc
......@@ -394,8 +394,20 @@ public class Roster implements Cacheable {
.getName());
// Set the groups to broadcast (include personal and shared groups)
List<String> groups = new ArrayList<String>(item.getGroups());
if (groups.contains(null)) {
Log.warn("A group is null in roster item: " + item.getJid() + " of user: " +
getUsername());
}
for (Group sharedGroup : item.getSharedGroups()) {
groups.add(sharedGroup.getProperties().get("sharedRoster.displayName"));
String displayName = sharedGroup.getProperties().get("sharedRoster.displayName");
if (displayName != null) {
groups.add(displayName);
}
else {
// Do not add the shared group if it does not have a displayName.
Log.warn("Found shared group: " + sharedGroup.getName() +
" with no displayName");
}
}
//if (item.getAskStatus() != RosterItem.ASK_NONE) {
roster.addItem(item.getJid(), item.getNickname(), ask, sub, groups);
......
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