Fixing NPE.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@328898 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-10-27 15:40:47 +00:00
parent 58e96169a6
commit 51f23d93d9
1 changed files with 7 additions and 4 deletions

View File

@ -175,11 +175,14 @@ public class ProjectSorter
project.addProjectReference( extProject );
MavenProject extParent = extProject.getParent();
String parentId = ArtifactUtils.versionlessKey( extParent.getGroupId(), extParent.getArtifactId() );
// Don't add edge from parent to extension if a reverse edge already exists
if ( !dag.hasEdge( extensionId, id ) || !parentId.equals( id ) )
if ( extParent != null )
{
dag.addEdge( id, extensionId );
String parentId = ArtifactUtils.versionlessKey( extParent.getGroupId(), extParent.getArtifactId() );
// Don't add edge from parent to extension if a reverse edge already exists
if ( !dag.hasEdge( extensionId, id ) || !parentId.equals( id ) )
{
dag.addEdge( id, extensionId );
}
}
}