Fix a panic in snapshot inspect command

This commit is contained in:
Kyle Havlovitz 2017-10-30 14:51:08 -07:00 committed by GitHub
parent b6ca9d25ca
commit fb464a8c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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())