diff --git a/diff.go b/diff.go index 6e3ae2f5ea50..b674eb8470b3 100644 --- a/diff.go +++ b/diff.go @@ -105,6 +105,9 @@ func (r *diffRemote) Compare(ctx context.Context, a, b []mount.Mount, opts ...di } func toDescriptor(d *types.Descriptor) ocispec.Descriptor { + if d == nil { + return ocispec.Descriptor{} + } return ocispec.Descriptor{ MediaType: d.MediaType, Digest: digest.Digest(d.Digest),