diff --git a/mojangtextures/mojang_textures.go b/mojangtextures/mojang_textures.go index a5252d2..c092169 100644 --- a/mojangtextures/mojang_textures.go +++ b/mojangtextures/mojang_textures.go @@ -1,7 +1,6 @@ package mojangtextures import ( - "errors" "regexp" "strings" "sync" @@ -92,7 +91,7 @@ func (ctx *Provider) GetForUsername(username string) (*mojang.SignedTexturesResp }) if !allowedUsernamesRegex.MatchString(username) { - return nil, errors.New("invalid username") + return nil, nil } username = strings.ToLower(username) diff --git a/mojangtextures/mojang_textures_test.go b/mojangtextures/mojang_textures_test.go index 4417d94..b4a328b 100644 --- a/mojangtextures/mojang_textures_test.go +++ b/mojangtextures/mojang_textures_test.go @@ -391,7 +391,7 @@ func (suite *providerTestSuite) TestGetForTheSameUsernames() { func (suite *providerTestSuite) TestGetForNotAllowedMojangUsername() { result, err := suite.Provider.GetForUsername("Not allowed") - suite.Assert().Error(err, "invalid username") + suite.Assert().Nil(err) suite.Assert().Nil(result) }