From fb464a8c0d8dabeb4b56ae9f718104313c194e8f Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Mon, 30 Oct 2017 14:51:08 -0700 Subject: [PATCH] Fix a panic in snapshot inspect command --- command/snapshot/inspect/snapshot_inspect.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command/snapshot/inspect/snapshot_inspect.go b/command/snapshot/inspect/snapshot_inspect.go index 78423e76f..e7a38315b 100644 --- a/command/snapshot/inspect/snapshot_inspect.go +++ b/command/snapshot/inspect/snapshot_inspect.go @@ -59,6 +59,7 @@ func (c *cmd) Run(args []string) int { meta, err := snapshot.Verify(f) if err != nil { c.UI.Error(fmt.Sprintf("Error verifying snapshot: %s", err)) + return 1 } var b bytes.Buffer @@ -70,6 +71,7 @@ func (c *cmd) Run(args []string) int { fmt.Fprintf(tw, "Version\t%d\n", meta.Version) if err = tw.Flush(); err != nil { c.UI.Error(fmt.Sprintf("Error rendering snapshot info: %s", err)) + return 1 } c.UI.Info(b.String())