Skip to content

Commit 15813d4

Browse files
authored
fix(client): Add nil check for SSHConfig before validating username/password (#1358)
Fixes #1357
1 parent d24c66c commit 15813d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config/endpoint/endpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ func (e *Endpoint) call(result *Result) {
498498
result.Duration = time.Since(startTime)
499499
} else if endpointType == TypeSSH {
500500
// If there's no username/password specified, attempt to validate just the SSH banner
501-
if len(e.SSHConfig.Username) == 0 && len(e.SSHConfig.Password) == 0 {
501+
if e.SSHConfig == nil || (len(e.SSHConfig.Username) == 0 && len(e.SSHConfig.Password) == 0) {
502502
result.Connected, result.HTTPStatus, err = client.CheckSSHBanner(strings.TrimPrefix(e.URL, "ssh://"), e.ClientConfig)
503503
if err != nil {
504504
result.AddError(err.Error())

0 commit comments

Comments
 (0)