You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ws...@apache.org on 2008/09/22 00:44:53 UTC
svn commit: r697632 -
/continuum/branches/CONTINUUM-1721/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
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,