Skip to content

Commit

Permalink
Adding an empty list for dependecy if its not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Narayan committed Dec 13, 2024
1 parent b93b961 commit b76a2ae
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/AlpineProcesser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Bom ParsePackageFile(CommonAppSettings appSettings)
public static Bom RemoveExcludedComponents(CommonAppSettings appSettings, Bom cycloneDXBOM)
{
List<Component> componentForBOM = cycloneDXBOM.Components.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies?.ToList() ?? new List<Dependency>();
int noOfExcludedComponents = 0;
if (appSettings.Alpine.ExcludedComponents != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/ConanProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ private static void GetDistinctComponentList(ref List<Component> listofComponent
private static Bom RemoveExcludedComponents(CommonAppSettings appSettings, Bom cycloneDXBOM)
{
List<Component> componentForBOM = cycloneDXBOM.Components.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies?.ToList() ?? new List<Dependency>();
int noOfExcludedComponents = 0;
if (appSettings.Conan.ExcludedComponents != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/DebianProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void AddSiemensDirectProperty(ref Bom bom)
public static Bom RemoveExcludedComponents(CommonAppSettings appSettings, Bom cycloneDXBOM)
{
List<Component> componentForBOM = cycloneDXBOM.Components.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies?.ToList() ?? new List<Dependency>();
int noOfExcludedComponents = 0;
if (appSettings.Debian.ExcludedComponents != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/NpmProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
public static Bom RemoveExcludedComponents(CommonAppSettings appSettings, Bom cycloneDXBOM)
{
List<Component> componentForBOM = cycloneDXBOM.Components.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies?.ToList() ?? new List<Dependency>();
int noOfExcludedComponents = 0;
if (appSettings.Npm.ExcludedComponents != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/NugetProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private static bool IsInternalNugetComponent(List<AqlResult> aqlResultList, Comp
public static Bom RemoveExcludedComponents(CommonAppSettings appSettings, Bom cycloneDXBOM)
{
List<Component> componentForBOM = cycloneDXBOM.Components.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies?.ToList() ?? new List<Dependency>();
int noOfExcludedComponents = 0;
if (appSettings.Nuget.ExcludedComponents != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LCT.PackageIdentifier/PythonProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private static Bom RemoveExcludedComponents(CommonAppSettings appSettings,
Bom cycloneDXBOM)
{
List<Component> componentForBOM = cycloneDXBOM.Components.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies.ToList();
List<Dependency> dependenciesForBOM = cycloneDXBOM.Dependencies?.ToList() ?? new List<Dependency>();
int noOfExcludedComponents = 0;
if (appSettings.Python.ExcludedComponents != null)
{
Expand Down

0 comments on commit b76a2ae

Please sign in to comment.