You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by br...@apache.org on 2006/04/07 05:25:06 UTC

svn commit: r392171 - /maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo

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();
+                }
             }
         }
     }