check error before defer close

pull/4584/head
Medya Gh 2019-06-24 21:09:23 -07:00
parent 129e2fdb18
commit e35f96d9e0
1 changed files with 1 additions and 1 deletions

View File

@ -204,10 +204,10 @@ func runStart(cmd *cobra.Command, args []string) {
}
m, err := machine.NewAPIClient()
defer m.Close()
if err != nil {
exit.WithError("Failed to get machine client", err)
}
defer m.Close()
// If --download-only, complete the remaining downloads and exit.
if viper.GetBool(downloadOnly) {