From 7a1653a2e9e0802677d34f513828b33c0ef5c576 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 29 Apr 2018 17:58:09 -0700 Subject: Make sure integrations are configured before to make any HTTP requests --- integration/wallabag/wallabag.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'integration/wallabag') diff --git a/integration/wallabag/wallabag.go b/integration/wallabag/wallabag.go index 58d9c5b..02a36b5 100644 --- a/integration/wallabag/wallabag.go +++ b/integration/wallabag/wallabag.go @@ -24,6 +24,10 @@ type Client struct { // AddEntry sends a link to Wallabag. func (c *Client) AddEntry(link, title string) error { + if c.baseURL == "" || c.clientID == "" || c.clientSecret == "" || c.username == "" || c.password == "" { + return fmt.Errorf("wallabag: missing credentials") + } + accessToken, err := c.getAccessToken() if err != nil { return err -- cgit v1.2.3