diff --git a/cache/refs.go b/cache/refs.go index 91e41b142855..d932f4e96c04 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -180,7 +180,10 @@ func (cr *cacheRecord) Size(ctx context.Context) (int64, error) { cr.mu.Unlock() return usage.Size, nil }) - return s.(int64), err + if err != nil { + return 0, err + } + return s.(int64), nil } func (cr *cacheRecord) Parent() ImmutableRef {