File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/com/redhat/exhort/integration/backend/sbom/cyclonedx Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ protected DependencyTree buildTree(InputStream input) {
6363 .collect (Collectors .toMap (Component ::getBomRef , c -> new PackageRef (c .getPurl ()))));
6464 }
6565
66- if ( bom . getMetadata () == null ) {
67- throw new ClientErrorException (
68- "Unable to parse CycloneDX SBOM. Missing metadata." , Response . Status . BAD_REQUEST );
66+ Optional < Component > rootComponent = Optional . empty ();
67+ if ( bom . getMetadata () != null ) {
68+ rootComponent = Optional . ofNullable ( bom . getMetadata (). getComponent () );
6969 }
70- var rootComponent = Optional . ofNullable ( bom . getMetadata (). getComponent ());
70+
7171 PackageRef rootRef = null ;
7272 if (rootComponent .isPresent ()) {
7373 if (rootComponent .get ().getPurl () != null ) {
You can’t perform that action at this time.
0 commit comments