Skip to content

Commit 960f2bc

Browse files
committed
Handle null layerIndices
1 parent 4d7a1d9 commit 960f2bc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Microsoft.ComponentDetection.Orchestrator/Services/GraphTranslation/DefaultGraphTranslationService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ private static bool IsExclusivelyFromBaseImage(DetectedComponent component, Dict
105105
return false;
106106
}
107107

108+
if (layerIndices == null)
109+
{
110+
// No layer indices for this container detail - keep the component.
111+
return false;
112+
}
113+
108114
foreach (var layerIndex in layerIndices)
109115
{
110116
if (!layersByIndex.TryGetValue(layerIndex, out var layer) || !layer.IsBaseImage)

0 commit comments

Comments
 (0)