cyclonedx-dotnet-library
cyclonedx-dotnet-library copied to clipboard
hierarchical merging with an SBOM that contains no root level components causes exception
While attempting to merge multiple BOMs with cyclonedx merge --hierarchical
I received:
Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'collection')
at System.Collections.Generic.List`1.InsertRange(Int32 , IEnumerable`1 )
at CycloneDX.Utils.CycloneDXUtils.HierarchicalMerge(IEnumerable`1 boms, Component bomSubject)
at CycloneDX.Cli.Commands.MergeCommand.Merge(MergeCommandOptions options)
at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
I believe this is caused by the absence of the root level components
property in one of the BOMs.
However, the cyclonedx validate
command reports:
BOM validated successfully.
Also, the spec doesn't indicate that the root level components
property is required.