maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r386835 - /maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
Date Sat, 18 Mar 2006 10:19:45 GMT
Author: brett
Date: Sat Mar 18 02:19:43 2006
New Revision: 386835

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

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java?rev=386835&r1=386834&r2=386835&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
Sat Mar 18 02:19:43 2006
@@ -691,7 +691,7 @@
             if ( menu.getItems().isEmpty() )
             {
                 List categoryReports = (List) categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION
);
-                if ( !categoryReports.isEmpty() )
+                if ( !isEmptyList( categoryReports ) )
                 {
                     MenuItem item = createCategoryMenu(
                         i18n.getString( "site-plugin", locale, "report.menu.projectinformation"
), "/project-info.html",
@@ -701,7 +701,7 @@
                 }
 
                 categoryReports = (List) categories.get( MavenReport.CATEGORY_PROJECT_REPORTS
);
-                if ( !categoryReports.isEmpty() )
+                if ( !isEmptyList( categoryReports ) )
                 {
                     MenuItem item = createCategoryMenu(
                         i18n.getString( "site-plugin", locale, "report.menu.projectreports"
), "/project-reports.html",
@@ -852,5 +852,10 @@
             }
         }
         return documents;
+    }
+
+    private static boolean isEmptyList( List list )
+    {
+        return list == null || list.isEmpty();
     }
 }



Mime
View raw message