From 986feef2e80cfaed7cbce0df4fd5d619bcffefd7 Mon Sep 17 00:00:00 2001 From: baude Date: Fri, 10 Jan 2020 10:26:43 -0600 Subject: fix e2e test failure it is possible for layers.names to be nil and we must account for that. Signed-off-by: baude --- libpod/image/image.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libpod') diff --git a/libpod/image/image.go b/libpod/image/image.go index c0baf2e00..bce10e24c 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -841,15 +841,17 @@ func (i *Image) History(ctx context.Context) ([]*History, error) { delete(topLayerMap, layer.ID) } } - - allHistory = append(allHistory, &History{ + h := History{ ID: id, Created: oci.History[x].Created, CreatedBy: oci.History[x].CreatedBy, Size: size, Comment: oci.History[x].Comment, - Tags: layer.Names, - }) + } + if layer != nil { + h.Tags = layer.Names + } + allHistory = append(allHistory, &h) if layer != nil && layer.Parent != "" && !oci.History[x].EmptyLayer { layer, err = i.imageruntime.store.Layer(layer.Parent) -- cgit v1.2.3-54-g00ecf