[MPLUGIN-210] NPE in generated help mojo with M2 when no goal has description
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1345805 13f79535-47bb-0310-9956-ffa450edef68master
parent
7230ba93e3
commit
017a3d5ca6
|
|
@ -170,6 +170,12 @@ public class HelpMojo
|
|||
}
|
||||
}
|
||||
|
||||
private String getValue( Xpp3Dom mojo, String child )
|
||||
{
|
||||
Xpp3Dom elt = mojo.getChild( child );
|
||||
return ( elt == null ) ? "" : elt.getValue();
|
||||
}
|
||||
|
||||
private void writeGoal( StringBuilder sb, String goalPrefix, Xpp3Dom mojo )
|
||||
{
|
||||
String mojoGoal = mojo.getChild( "goal" ).getValue();
|
||||
|
|
@ -185,12 +191,12 @@ public class HelpMojo
|
|||
if ( detail )
|
||||
{
|
||||
append( sb, "", 0 );
|
||||
append( sb, mojo.getChild( "description" ).getValue(), 1 );
|
||||
append( sb, getValue( mojo, "description" ), 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
append( sb, mojo.getChild( "description" ).getValue(), 1 );
|
||||
append( sb, getValue( mojo, "description" ), 1 );
|
||||
}
|
||||
append( sb, "", 0 );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue