From 3d529094fa4a0b7164f329176fbc003b629dd477 Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 10 Apr 2015 15:56:29 -0700 Subject: [PATCH] Prevent Close() from being called after Finish() --- AUTHORS | 5 ++++- registry/storage/layerwriter.go | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index ac5c0cce..0889d1eb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,7 @@ Andrey Kostov Andy Goldstein Anton Tiurin Arnaud Porterie +Ben Firshman Brian Bland David Lawrence Derek McGowan @@ -11,11 +12,13 @@ Diogo Mónica Donald Huang Frederick F. Kautz IV Josh Hawn +Mary Anthony +Nathan Sullivan Nghia Tran Olivier Gambier Richard Shreyas Karnik +Simon Thulbourn Stephen J Day Tianon Gravi xiekeyang -Mary Anthony diff --git a/registry/storage/layerwriter.go b/registry/storage/layerwriter.go index ccd8679b..58078459 100644 --- a/registry/storage/layerwriter.go +++ b/registry/storage/layerwriter.go @@ -109,6 +109,10 @@ func (lw *layerWriter) ReadFrom(r io.Reader) (n int64, err error) { } func (lw *layerWriter) Close() error { + if lw.err != nil { + return lw.err + } + if err := lw.storeHashState(); err != nil { return err }