From 34a4371dde6687de8e1a602f7f5bb244812a284d Mon Sep 17 00:00:00 2001 From: "Thibault \"bui\" Koechlin" Date: Fri, 23 Jul 2021 15:10:43 +0200 Subject: [PATCH] check if api:client is present (#867) --- cmd/crowdsec-cli/machines.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crowdsec-cli/machines.go b/cmd/crowdsec-cli/machines.go index 91f2ab469..f94b9b8b8 100644 --- a/cmd/crowdsec-cli/machines.go +++ b/cmd/crowdsec-cli/machines.go @@ -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 }