Return-Path: Delivered-To: apmail-continuum-commits-archive@www.apache.org Received: (qmail 20140 invoked from network); 21 Sep 2008 22:45:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Sep 2008 22:45:44 -0000 Received: (qmail 22865 invoked by uid 500); 21 Sep 2008 22:45:41 -0000 Delivered-To: apmail-continuum-commits-archive@continuum.apache.org Received: (qmail 22850 invoked by uid 500); 21 Sep 2008 22:45:41 -0000 Mailing-List: contact commits-help@continuum.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@continuum.apache.org Delivered-To: mailing list commits@continuum.apache.org Received: (qmail 22841 invoked by uid 99); 21 Sep 2008 22:45:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Sep 2008 15:45:41 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Sep 2008 22:44:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9C750238896F; Sun, 21 Sep 2008 15:44:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@continuum.apache.org From: wsmoak@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080921224453.9C750238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 getNotifiers( ContinuumProjectBuildingResult result, MavenProject mavenProject,