From d3f5c3d7555d76887abef3bf4de5d36e5a75137a Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Tue, 11 Oct 2005 04:38:44 +0000 Subject: [PATCH] PR: MNG-1162 better error handling for invalid pom reference git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312809 13f79535-47bb-0310-9956-ffa450edef68 --- maven-artifact-ant/sample.build.xml | 6 ++++++ .../src/main/java/org/apache/maven/artifact/ant/Pom.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/maven-artifact-ant/sample.build.xml b/maven-artifact-ant/sample.build.xml index 5d4e319d29..2b062fdf44 100644 --- a/maven-artifact-ant/sample.build.xml +++ b/maven-artifact-ant/sample.build.xml @@ -196,5 +196,11 @@ + + + + + + diff --git a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Pom.java b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Pom.java index 379e15cbb5..e12d509548 100755 --- a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Pom.java +++ b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Pom.java @@ -86,6 +86,10 @@ public class Pom if ( refid != null ) { instance = (Pom) getProject().getReference( refid ); + if ( instance == null ) + { + throw new BuildException( "Invalid reference: '" + refid + "'" ); + } } return instance; }