Author: berndf
Date: Thu Jun  7 09:56:58 2012
New Revision: 1347555

URL: http://svn.apache.org/viewvc?rev=1347555&view=rev
Log:
tolerate RosterManager's absense

Modified:
    
mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterUtils.java

Modified: 
mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterUtils.java
URL: 
http://svn.apache.org/viewvc/mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterUtils.java?rev=1347555&r1=1347554&r2=1347555&view=diff
==============================================================================
--- 
mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterUtils.java
 (original)
+++ 
mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterUtils.java
 Thu Jun  7 09:56:58 2012
@@ -24,6 +24,7 @@ import static org.apache.vysper.complian
 import static 
org.apache.vysper.compliance.SpecCompliant.ComplianceStatus.FINISHED;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -52,6 +53,8 @@ public class RosterUtils {
      * are needed and then all TO items - but the roster is only iterated 
once. 
      */
     public static Map<SubscriptionType, List<RosterItem>> 
getRosterItemsByState(RosterManager rosterManager, Entity user) {
+        if (rosterManager == null) return Collections.emptyMap();
+        
         Map<SubscriptionType, List<RosterItem>> rosterItemMap = new 
HashMap<SubscriptionType, List<RosterItem>>();
 
         rosterItemMap.put(SubscriptionType.FROM, new ArrayList<RosterItem>());


Reply via email to