o Fixed NPEs

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@828249 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-10-21 23:27:21 +00:00
parent c501175f79
commit 412ab3371b
2 changed files with 17 additions and 5 deletions

View File

@ -203,12 +203,24 @@ public class DefaultExceptionHandler
{
String exceptionMessage = t.getMessage();
if ( exceptionMessage == null )
{
exceptionMessage = "";
}
if ( t instanceof AbstractMojoExecutionException )
{
String longMessage = ( (AbstractMojoExecutionException) t ).getLongMessage();
if ( StringUtils.isNotEmpty( longMessage ) )
{
exceptionMessage = longMessage;
if ( StringUtils.isEmpty( exceptionMessage ) || longMessage.contains( exceptionMessage ) )
{
exceptionMessage = longMessage;
}
else
{
exceptionMessage += ": " + longMessage;
}
}
}

View File

@ -1800,8 +1800,8 @@ public class MavenProject
protected ArtifactRepository getReleaseArtifactRepository()
{
if ( getDistributionManagement().getRepository() != null )
{
if ( getDistributionManagement() != null && getDistributionManagement().getRepository() != null )
{
try
{
ArtifactRepository repo =
@ -1819,8 +1819,8 @@ public class MavenProject
protected ArtifactRepository getSnapshotArtifactRepository()
{
if ( getDistributionManagement().getSnapshotRepository() != null )
{
if ( getDistributionManagement() != null && getDistributionManagement().getSnapshotRepository() != null )
{
try
{
ArtifactRepository repo =