mirror of
https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git
synced 2024-12-04 21:08:11 +00:00
fixed NPE
This commit is contained in:
parent
d3f75ebe3b
commit
a13a1f0819
1 changed files with 2 additions and 3 deletions
|
@ -61,12 +61,11 @@ 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.
|
||||
|
|
Loading…
Reference in a new issue