From 13264a15295a146c4f2c497f36e3aa8dad61aba4 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Mon, 30 Oct 2023 20:21:20 +0200 Subject: [PATCH] fix: add missed null check in docker_image_dest.go As the documentation says, "It is always OK to pass nil instead of a SystemContext." Signed-off-by: Bojidar Marinov --- docker/docker_image_dest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker_image_dest.go b/docker/docker_image_dest.go index b966ff751..ce0768ddc 100644 --- a/docker/docker_image_dest.go +++ b/docker/docker_image_dest.go @@ -137,7 +137,7 @@ func (d *dockerImageDestination) PutBlobWithOptions(ctx context.Context, stream // If requested, precompute the blob digest to prevent uploading layers that already exist on the registry. // This functionality is particularly useful when BlobInfoCache has not been populated with compressed digests, // the source blob is uncompressed, and the destination blob is being compressed "on the fly". - if inputInfo.Digest == "" && d.c.sys.DockerRegistryPushPrecomputeDigests { + if inputInfo.Digest == "" && d.c.sys != nil && d.c.sys.DockerRegistryPushPrecomputeDigests { logrus.Debugf("Precomputing digest layer for %s", reference.Path(d.ref.ref)) streamCopy, cleanup, err := streamdigest.ComputeBlobInfo(d.c.sys, stream, &inputInfo) if err != nil {