maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r392171 - /maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
Date Fri, 07 Apr 2006 03:25:06 GMT
Author: brett
Date: Thu Apr  6 20:25:05 2006
New Revision: 392171

URL: http://svn.apache.org/viewcvs?rev=392171&view=rev
Log:
prevent NPE

Modified:
    maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo

Modified: maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo?rev=392171&r1=392170&r2=392171&view=diff
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo (original)
+++ maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo Thu Apr  6 20:25:05
2006
@@ -107,13 +107,16 @@
         {
             menusByRef = new java.util.HashMap();
 
-            for ( java.util.Iterator i = body.getMenus().iterator(); i.hasNext(); )
+            if ( body != null )
             {
-                Menu menu = (Menu) i.next();
-
-                if ( menu.getRef() != null )
+                for ( java.util.Iterator i = body.getMenus().iterator(); i.hasNext(); )
                 {
-                    menusByRef.put( menu.getRef(), menu );
+                    Menu menu = (Menu) i.next();
+
+                    if ( menu.getRef() != null )
+                    {
+                        menusByRef.put( menu.getRef(), menu );
+                    }
                 }
             }
         }
@@ -122,12 +125,15 @@
 
     public void removeMenuRef( String key )
     {
-        for ( java.util.Iterator i = body.getMenus().iterator(); i.hasNext(); )
+        if ( body != null )
         {
-            Menu menu = (Menu) i.next();
-            if ( key.equals( menu.getRef() ) )
+            for ( java.util.Iterator i = body.getMenus().iterator(); i.hasNext(); )
             {
-                i.remove();
+                Menu menu = (Menu) i.next();
+                if ( key.equals( menu.getRef() ) )
+                {
+                    i.remove();
+                }
             }
         }
     }



Mime
View raw message