Merge pull request #784 from vbatts/no_images_list
kpod-images: don't nil pointer on empty list
This commit is contained in:
commit
a1071649f0
1 changed files with 5 additions and 1 deletions
|
@ -163,7 +163,11 @@ func outputImages(store storage.Store, images []storage.Image, truncate, digests
|
||||||
case formats.JSONString:
|
case formats.JSONString:
|
||||||
out = formats.JSONStructArray{Output: toGeneric(imageOutput)}
|
out = formats.JSONStructArray{Output: toGeneric(imageOutput)}
|
||||||
default:
|
default:
|
||||||
out = formats.StdoutTemplateArray{Output: toGeneric(imageOutput), Template: outputFormat, Fields: imageOutput[0].headerMap()}
|
if len(imageOutput) == 0 {
|
||||||
|
out = formats.StdoutTemplateArray{}
|
||||||
|
} else {
|
||||||
|
out = formats.StdoutTemplateArray{Output: toGeneric(imageOutput), Template: outputFormat, Fields: imageOutput[0].headerMap()}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
formats.Writer(out).Out()
|
formats.Writer(out).Out()
|
||||||
|
|
Loading…
Reference in a new issue