You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by br...@apache.org on 2006/12/13 08:52:08 UTC

svn commit: r486538 - /maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Author: brett
Date: Tue Dec 12 23:52:07 2006
New Revision: 486538

URL: http://svn.apache.org/viewvc?view=rev&rev=486538
Log:
prevent an NPE
Submitted by: Franz Allen Valencia See

Modified:
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?view=diff&rev=486538&r1=486537&r2=486538
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Tue Dec 12 23:52:07 2006
@@ -223,20 +223,24 @@
 
         // iterate through the project groups and make sure we are not walking over projects that
         // might define their own build definitions
-        for ( Iterator i = projectGroupSource.keySet().iterator(); i.hasNext(); )
+        if ( projectGroupSource != null )
         {
-            Integer projectGroupId = (Integer) i.next();
-            List projectsInGroup = getProjectsInGroup( projectGroupId.intValue() );
-
-            for ( Iterator j = projectsInGroup.iterator(); j.hasNext(); )
+        	for ( Iterator i = projectGroupSource.keySet().iterator(); i.hasNext(); )
             {
-                Integer projectId = new Integer( ( (Project) j.next() ).getId() );
-                if ( !aggregate.keySet().contains( projectId ) )
+                Integer projectGroupId = (Integer) i.next();
+                List projectsInGroup = getProjectsInGroup( projectGroupId.intValue() );
+
+                for ( Iterator j = projectsInGroup.iterator(); j.hasNext(); )
                 {
-                    aggregate.put( projectId, projectGroupSource.get( projectGroupId ) );
+                    Integer projectId = new Integer( ( (Project) j.next() ).getId() );
+                    if ( !aggregate.keySet().contains( projectId ) )
+                    {
+                        aggregate.put( projectId, projectGroupSource.get( projectGroupId ) );
+                    }
                 }
             }
         }
+        
         return aggregate;
     }