Skip to content

Commit

Permalink
fix(client): add one more validation for check list configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ikr4-m committed Aug 16, 2024
1 parent 1e812eb commit cb8f3b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/mdrop-client/get_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions cmd/mdrop-client/send_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb8f3b7

Please sign in to comment.