fixed NPE
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tobias Trabelsi 2022-06-08 21:29:01 +02:00
parent d3f75ebe3b
commit d458b7d3f9
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E

View File

@ -61,12 +61,12 @@ func (c *Config) Client() (interface{}, error) {
var client *gitea.Client
if c.Token != "" {
client, _ = gitea.NewClient(c.BaseURL, gitea.SetToken(c.Token))
client, _ = gitea.NewClient(c.BaseURL, gitea.SetToken(c.Token), gitea.SetHTTPClient(httpClient))
}
client.SetHTTPClient(httpClient)
if c.Username != "" {
client.SetBasicAuth(c.Username, c.Password)
client, _ = gitea.NewClient(c.BaseURL, gitea.SetBasicAuth(c.Username, c.Password), gitea.SetHTTPClient(httpClient))
}
// Test the credentials by checking we can get information about the authenticated user.