Skip to content

Commit

Permalink
fix: check for nil PreCopy
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle M. Tarplee <[email protected]>
  • Loading branch information
ktarplee committed Oct 31, 2023
1 parent 75c7e96 commit 46b08cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ func (opts *CopyGraphOptions) WithMount(sourceRepository string, mounter registr
opts.PreCopy = func(ctx context.Context, desc ocispec.Descriptor) error {
// Only care to mount blobs
if descriptor.IsManifest(desc) {
return preCopy(ctx, desc)
// still want to call PreCopy if it is a manifest
if preCopy != nil {
return preCopy(ctx, desc)
}
return nil
}

var mountFailed bool
Expand Down

0 comments on commit 46b08cb

Please sign in to comment.