fix possible NPE as filter can be null (dependency:tree)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@785405 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2009-06-16 21:11:33 +00:00
parent 17d876713c
commit 0852f8d21d
1 changed files with 5 additions and 3 deletions

View File

@ -250,10 +250,12 @@ public class MavenProject
for ( Dependency d : getDependencies() )
{
Artifact dependencyArtifact = repositorySystem.createArtifact( d.getGroupId(), d.getArtifactId(), d.getVersion(), d.getScope(), d.getType() );
if ( filter.include( dependencyArtifact ) )
if ( filter != null )
{
artifacts.add( dependencyArtifact );
if ( filter.include( dependencyArtifact ) )
{
artifacts.add( dependencyArtifact );
}
}
}