continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r697632 - /continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Date Sun, 21 Sep 2008 22:44:53 GMT
Author: wsmoak
Date: Sun Sep 21 15:44:52 2008
New Revision: 697632

URL: http://svn.apache.org/viewvc?rev=697632&view=rev
Log:
[CONTINUUM-1721] Guard against NPE from now-optional scm element.  Also check if project is
null.

Modified:
    continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java

Modified: continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewvc/continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=697632&r1=697631&r2=697632&view=diff
==============================================================================
--- continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Sun Sep 21 15:44:52 2008
@@ -481,9 +481,19 @@
         return name;
     }
 
+  /**
+   * @return the scm connection url from the project, or null if none is present
+   */
     private String getScmUrl( MavenProject project )
     {
-        return project.getScm().getConnection();
+        if ( project != null && project.getScm() != null )
+        {
+            return project.getScm().getConnection();
+        }
+        return null;
+
+      //TODO:  What if the project has only a developerConnection (no anonymous access?)
+      //TODO:  Should this return an empty string instead of null if there is no url?
     }
 
     private List<ProjectNotifier> getNotifiers( ContinuumProjectBuildingResult result,
MavenProject mavenProject,



Mime
View raw message