check if api:client is present (#867)

This commit is contained in:
Thibault "bui" Koechlin 2021-07-23 15:10:43 +02:00 committed by GitHub
parent 535f0353df
commit 34a4371dde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,7 @@ cscli machines add MyTestMachine --password MyPassword
/*check if file already exists*/
if outputFile != "" {
dumpFile = outputFile
} else if csConfig.API.Client.CredentialsFilePath != "" {
} else if csConfig.API.Client != nil && csConfig.API.Client.CredentialsFilePath != "" {
dumpFile = csConfig.API.Client.CredentialsFilePath
}