diff --git a/cmd/mdrop-client/get_command.go b/cmd/mdrop-client/get_command.go index 72523f3..41643bc 100644 --- a/cmd/mdrop-client/get_command.go +++ b/cmd/mdrop-client/get_command.go @@ -42,6 +42,9 @@ func GetCommand(args []string) { if err != nil { internal.PrintErrorWithExit("getParseConfigError", err, 1) } + if len(authFile.ListConfiguration) == 0 { + internal.PrintErrorWithExit("getConfigFileEmpty", errors.New("Config file empty. Please log in using `mdrop auth` before executing this command."), 1) + } config := authFile.ListConfiguration[authFile.Default] if sender.Host != config.Host { internal.PrintErrorWithExit("getHostNotMatch", errors.New("Host not match"), 1) diff --git a/cmd/mdrop-client/send_command.go b/cmd/mdrop-client/send_command.go index 9accbab..bccdad3 100644 --- a/cmd/mdrop-client/send_command.go +++ b/cmd/mdrop-client/send_command.go @@ -37,6 +37,9 @@ func SendCommand(args []string) { if err != nil { internal.PrintErrorWithExit("sendParseConfigError", err, 1) } + if len(authFile.ListConfiguration) == 0 { + internal.PrintErrorWithExit("getConfigFileEmpty", errors.New("Config file empty. Please log in using `mdrop auth` before executing this command."), 1) + } config := authFile.ListConfiguration[authFile.Default] // Get Port from Tunnel