fix(aggregate): Added a safeguard for docker image being present or creator not being present. (Fixes
@@ -113,7 +113,13 @@ public class AggregateBdioCreator {
final File codeLocationSourceDir = new File(codeLocationSourcePath);
final String relativePath = FileNameUtils.relativize(sourcePath.getAbsolutePath(), codeLocationSourceDir.getAbsolutePath());
- final String bomToolType = codeLocation.getCreatorName().get().toLowerCase();
+ String bomToolType;
+ if (codeLocation.getDockerImageName().isPresent()) {
+ bomToolType = "docker"; // TODO: Should docker image name be considered here?
+ } else {
+ bomToolType = codeLocation.getCreatorName().orElse("unknown").toLowerCase();
+ }
+
final List<String> externalIdPieces = new ArrayList<>();
externalIdPieces.addAll(Arrays.asList(original.getExternalIdPieces()));
externalIdPieces.add(relativePath);
