From a13a1f0819b907e3c62e46582827e1fe674ad398 Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Wed, 8 Jun 2022 21:29:01 +0200 Subject: [PATCH] fixed NPE --- gitea/config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gitea/config.go b/gitea/config.go index 2003f52..39bd524 100644 --- a/gitea/config.go +++ b/gitea/config.go @@ -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.