mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
src: add nil checks
Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
parent
89e7b8f22b
commit
5098048f82
|
@ -273,10 +273,12 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI
|
|||
}
|
||||
|
||||
rootfs := docker.RootFS{}
|
||||
rootfs.Type = info.RootFS.Type
|
||||
rootfs.Layers = make([]string, 0, len(info.RootFS.Layers))
|
||||
for _, layer := range info.RootFS.Layers {
|
||||
rootfs.Layers = append(rootfs.Layers, string(layer))
|
||||
if info.RootFS != nil && info.RootFS.Layers != nil {
|
||||
rootfs.Type = info.RootFS.Type
|
||||
rootfs.Layers = make([]string, 0, len(info.RootFS.Layers))
|
||||
for _, layer := range info.RootFS.Layers {
|
||||
rootfs.Layers = append(rootfs.Layers, string(layer))
|
||||
}
|
||||
}
|
||||
dockerImageInspect := docker.ImageInspect{
|
||||
Architecture: l.Architecture,
|
||||
|
|
Loading…
Reference in a new issue