Skip to content

Commit

Permalink
Merge pull request #6 from blackducksoftware/handle_children
Browse files Browse the repository at this point in the history
adding null check for children
  • Loading branch information
ekerwin committed Jun 18, 2017
2 parents 837cde8 + 74c630b commit 941df4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>integration-bdio</artifactId>
<version>4.0.1-SNAPSHOT</version>
<version>4.0.1</version>

<name>Integration Bdio</name>
<description>A light-weight bdio construction library</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,19 @@ public SimpleBdioDocument transformDependencyNode(final String hubCodeLocationNa
simpleBdioDocument.billOfMaterials = billOfMaterials;
simpleBdioDocument.project = project;

for (final DependencyNode child : root.children) {
final BdioComponent component = componentFromDependencyNode(child);
bdioPropertyHelper.addRelationship(project, component);
if (root.children != null && root.children.size() > 0) {
for (final DependencyNode child : root.children) {
final BdioComponent component = componentFromDependencyNode(child);
bdioPropertyHelper.addRelationship(project, component);
}
}

final List<BdioComponent> bdioComponents = new ArrayList<>();
final Set<String> alreadyAddedIds = new HashSet<>();
for (final DependencyNode child : root.children) {
transformDependencyGraph(bdioComponents, child, alreadyAddedIds);
if (root.children != null && root.children.size() > 0) {
for (final DependencyNode child : root.children) {
transformDependencyGraph(bdioComponents, child, alreadyAddedIds);
}
}
simpleBdioDocument.components = bdioComponents;

Expand Down

0 comments on commit 941df4e

Please sign in to comment.