maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r891591 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Date Thu, 17 Dec 2009 09:03:31 GMT
Author: ltheussl
Date: Thu Dec 17 09:03:31 2009
New Revision: 891591

URL: http://svn.apache.org/viewvc?rev=891591&view=rev
Log:
[MPDF-35] NPE when document descriptor has no meta information

Modified:
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=891591&r1=891590&r2=891591&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
(original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Thu Dec 17 09:03:31 2009
@@ -49,6 +49,7 @@
 import org.apache.maven.doxia.docrenderer.DocumentRendererContext;
 import org.apache.maven.doxia.docrenderer.DocumentRendererException;
 import org.apache.maven.doxia.docrenderer.pdf.PdfRenderer;
+import org.apache.maven.doxia.document.DocumentMeta;
 import org.apache.maven.doxia.document.DocumentModel;
 import org.apache.maven.doxia.document.DocumentTOCItem;
 import org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Writer;
@@ -782,6 +783,11 @@
             throw new MojoExecutionException( "Error opening DocumentDescriptor!", io );
         }
 
+        if ( model.getMeta() == null )
+        {
+            model.setMeta( new DocumentMeta() );
+        }
+
         if ( StringUtils.isEmpty( model.getMeta().getLanguage() ) )
         {
             model.getMeta().setLanguage( locale.getLanguage() );



Mime
View raw message