[Arakhnę-Dev] [225] * Avoid NullPointerException.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 225
Author:   galland
Date:     2011-06-03 19:32:38 +0200 (Fri, 03 Jun 2011)
Log Message:
-----------
* Avoid NullPointerException.

Modified Paths:
--------------
    trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java

Modified: trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java
===================================================================
--- trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java	2011-06-03 17:31:46 UTC (rev 224)
+++ trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java	2011-06-03 17:32:38 UTC (rev 225)
@@ -257,7 +257,12 @@
 					filename);	
 			
 			StringBuffer authorsText = new StringBuffer();
-			authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", this.projectURL.toExternalForm())); //$NON-NLS-1$
+			if (this.projectURL!=null) {
+				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", this.projectURL.toExternalForm())); //$NON-NLS-1$
+			}
+			else {
+				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", "")); //$NON-NLS-1$ //$NON-NLS-2$
+			}
 			authorsText.append("\n\n"); //$NON-NLS-1$
 			authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER_TITLE", this.name)); //$NON-NLS-1$
 			authorsText.append("\n\n"); //$NON-NLS-1$
@@ -286,7 +291,7 @@
 			fileWriter.close();			
     	}
     	catch(IOException e) {
-    		throw new MojoExecutionException(e.toString(), e);
+    		throw new RuntimeException(e);
     	}
     	
     }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/