mirror of
https://github.com/containers/podman.git
synced 2025-06-21 09:28:09 +08:00
Merge pull request #3643 from openSUSE/history-panic
Fix possible runtime panic if image history len is zero
This commit is contained in:
@ -1298,8 +1298,11 @@ func (i *Image) Comment(ctx context.Context, manifestType string) (string, error
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(ociv1Img.History) > 0 {
|
||||
return ociv1Img.History[0].Comment, nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Save writes a container image to the filesystem
|
||||
func (i *Image) Save(ctx context.Context, source, format, output string, moreTags []string, quiet, compress bool) error {
|
||||
|
Reference in New Issue
Block a user