Fix panic when remote differ returns empty result

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan 2023-04-29 22:55:21 -07:00
parent 54732fa9fb
commit 0d975230e1
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB

View File

@ -100,6 +100,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),