fix NPE when there is no goal configuration

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-24 07:54:34 +00:00
parent 4ba9fbcc33
commit 886d787bf4
1 changed files with 10 additions and 3 deletions

View File

@ -683,14 +683,21 @@ public class DefaultPluginManager
if ( index >= 0 )
{
String goalName = goalId.substring( index + 1 );
for ( Iterator j = plugin.getGoals().iterator(); j.hasNext(); )
for ( Iterator j = plugin.getGoals().iterator(); j.hasNext() && dom == null; )
{
Goal goal = (Goal) j.next();
if ( goal.getId().equals( goalName ) )
{
Xpp3Dom goalConfiguration = (Xpp3Dom) goal.getConfiguration();
dom = Xpp3DomUtils.mergeXpp3Dom( Xpp3DomUtils.copyXpp3Dom( goalConfiguration ), dom );
break;
if ( goalConfiguration != null )
{
dom =
Xpp3DomUtils.mergeXpp3Dom( Xpp3DomUtils.copyXpp3Dom( goalConfiguration ), dom );
}
else
{
dom = new Xpp3Dom( "configuration" );
}
}
}
}