Skip to content

Commit 59d56b9

Browse files
committed
fix: update vulnerability handling to check for non-null vulnerability summary before displaying warnings
1 parent c6f7e23 commit 59d56b9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/lib/components/Image.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<div class="wrapper">
6161
<Heading level="3" size="small">Vulnerabilities</Heading>
6262

63-
{#if !image.hasSBOM}
63+
{#if !image.hasSBOM && image.vulnerabilitySummary !== null}
6464
<BodyShort>
6565
<WarningIcon class="text-aligned-icon" /> Data was discovered, but the SBOM was not rendered.
6666
Please refer to the <Link href={docURL('/services/vulnerabilities/')}

src/routes/team/[team]/[env]/app/[app]/image/+page.svelte

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@
7171
<Card columns={3}>
7272
<div class="summary">
7373
<Heading level="4" size="small" spacing>Summary</Heading>
74+
7475
{#if image.vulnerabilitySummary}
7576
<VulnerabilityBadges summary={image.vulnerabilitySummary} />
76-
{:else if !image.hasSBOM}
77+
{:else if !image.hasSBOM && image.vulnerabilitySummary !== null}
7778
<WarningIcon class="text-aligned-icon" />
7879
Data was discovered, but the SBOM was not rendered. Please refer to the
7980
<a href={docURL('/services/vulnerabilities/')}>NAIS documentation</a>

src/routes/team/[team]/[env]/job/[job]/image/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<Heading level="4" size="small" spacing>Summary</Heading>
7171
{#if image.vulnerabilitySummary}
7272
<VulnerabilityBadges summary={image.vulnerabilitySummary} />
73-
{:else if !image.hasSBOM}
73+
{:else if !image.hasSBOM && image.vulnerabilitySummary !== null}
7474
<WarningIcon class="text-aligned-icon" />
7575
Data was discovered, but the SBOM was not rendered. Please refer to the
7676
<a href={docURL('/services/vulnerabilities/')}>NAIS documentation</a>

0 commit comments

Comments
 (0)