From 05d9156a992b7df3b5d7fd85020f8da7d2bea863 Mon Sep 17 00:00:00 2001 From: Meredith Lancaster Date: Tue, 1 Apr 2025 11:16:00 -0600 Subject: [PATCH] add check for nil api client Signed-off-by: Meredith Lancaster --- pkg/cmd/attestation/download/download.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/attestation/download/download.go b/pkg/cmd/attestation/download/download.go index 86cf08d72..2cb648414 100644 --- a/pkg/cmd/attestation/download/download.go +++ b/pkg/cmd/attestation/download/download.go @@ -127,6 +127,9 @@ func runDownload(opts *Options) error { opts.Logger.VerbosePrintf("Downloading trusted metadata for artifact %s\n\n", opts.ArtifactPath) + if opts.APIClient == nil { + return fmt.Errorf("no APIClient provided") + } params := api.FetchParams{ Digest: artifact.DigestWithAlg(), Limit: opts.Limit,