From 083a7dd4f04612fb9590f7f28199710c263e54a9 Mon Sep 17 00:00:00 2001 From: Brian E Fox Date: Mon, 5 Nov 2007 09:49:13 +0000 Subject: [PATCH] fixed NPE in exception msg git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@591938 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/project/ProjectBuildingException.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/maven-project/src/main/java/org/apache/maven/project/ProjectBuildingException.java b/maven-project/src/main/java/org/apache/maven/project/ProjectBuildingException.java index 8b7d9dfab2..14441192bf 100644 --- a/maven-project/src/main/java/org/apache/maven/project/ProjectBuildingException.java +++ b/maven-project/src/main/java/org/apache/maven/project/ProjectBuildingException.java @@ -276,13 +276,20 @@ public class ProjectBuildingException /** * @deprecated use {@link #getPomUri()} */ - public String getPomLocation() + public String getPomLocation () { - if ( "file".equals( getPomUri().getScheme() ) ) + if ( getPomUri() != null ) { - return new File( getPomUri() ).getAbsolutePath(); + if ( "file".equals( getPomUri().getScheme() ) ) + { + return new File( getPomUri() ).getAbsolutePath(); + } + return getPomUri().toString(); + } + else + { + return "null"; } - return getPomUri().toString(); } public String getProjectId()