summaryrefslogtreecommitdiff
path: root/libpod/image/layer_tree.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/image/layer_tree.go')
-rw-r--r--libpod/image/layer_tree.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/image/layer_tree.go b/libpod/image/layer_tree.go
index 3699655fd..18101575e 100644
--- a/libpod/image/layer_tree.go
+++ b/libpod/image/layer_tree.go
@@ -32,7 +32,9 @@ func (t *layerTree) toOCI(ctx context.Context, i *Image) (*ociv1.Image, error) {
oci, exists := t.ociCache[i.ID()]
if !exists {
oci, err = i.ociv1Image(ctx)
- t.ociCache[i.ID()] = oci
+ if err == nil {
+ t.ociCache[i.ID()] = oci
+ }
}
return oci, err
}