diff --git a/authentication/allowed_hosts_validator.go b/authentication/allowed_hosts_validator.go index 805be5f..3556526 100644 --- a/authentication/allowed_hosts_validator.go +++ b/authentication/allowed_hosts_validator.go @@ -25,7 +25,7 @@ func NewAllowedHostsValidator(validHosts []string) AllowedHostsValidator { func NewAllowedHostsValidatorErrorCheck(validHosts []string) (*AllowedHostsValidator, error) { result := &AllowedHostsValidator{} if err := result.SetAllowedHostsErrorCheck(validHosts); err != nil { - return result, err + return nil, err } return result, nil } diff --git a/authentication/allowed_hosts_validator_test.go b/authentication/allowed_hosts_validator_test.go index 4a94bfd..312f387 100644 --- a/authentication/allowed_hosts_validator_test.go +++ b/authentication/allowed_hosts_validator_test.go @@ -15,6 +15,7 @@ func TestItValidatesHostsUseNewAllowedHostsValidator(t *testing.T) { } func TestItValidatesHostsUseNewAllowedHostsValidatorErrorCheck(t *testing.T) { - _, err := NewAllowedHostsValidatorErrorCheck([]string{"http://graph.microsoft.com"}) + validator, err := NewAllowedHostsValidatorErrorCheck([]string{"http://graph.microsoft.com"}) assert.EqualValues(t, ErrInvalidHostPrefix, err) + assert.Nil(t, validator) }