mirror of https://github.com/apache/maven.git
fix NPE
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3d0ba0846
commit
677a0dd7d5
|
@ -159,7 +159,10 @@ public class DefaultMavenProjectBuilder
|
||||||
|
|
||||||
private Map createManagedVersionMap( DependencyManagement dependencyManagement )
|
private Map createManagedVersionMap( DependencyManagement dependencyManagement )
|
||||||
{
|
{
|
||||||
Map map = new HashMap();
|
Map map;
|
||||||
|
if ( dependencyManagement != null && dependencyManagement.getDependencies() != null )
|
||||||
|
{
|
||||||
|
map = new HashMap();
|
||||||
for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
|
for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
|
||||||
{
|
{
|
||||||
Dependency d = (Dependency) i.next();
|
Dependency d = (Dependency) i.next();
|
||||||
|
@ -169,6 +172,11 @@ public class DefaultMavenProjectBuilder
|
||||||
|
|
||||||
map.put( d.getManagementKey(), artifact );
|
map.put( d.getManagementKey(), artifact );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
map = Collections.EMPTY_MAP;
|
||||||
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue