o merged r609576 (MNG-2925: NullPointerException in PluginDescriptor.getMojo() if there's no mojo in pom.xml)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@609577 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2008-01-07 11:46:27 +00:00
parent ff53010e7e
commit 4e41fbea47
1 changed files with 10 additions and 5 deletions

View File

@ -258,6 +258,11 @@ public class PluginDescriptor
public MojoDescriptor getMojo( String goal )
{
if ( getMojos() == null )
{
return null; // no mojo in this POM
}
// TODO: could we use a map? Maybe if the parent did that for components too, as this is too vulnerable to
// changes above not being propogated to the map