From 441f1222fc7f0d41c084c128774d6abbe3895a54 Mon Sep 17 00:00:00 2001 From: Andy Lo-A-Foe Date: Thu, 21 Oct 2021 10:54:08 +0200 Subject: [PATCH] Defensive coding --- iam/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iam/client.go b/iam/client.go index 3b1f5580..a30e9f67 100644 --- a/iam/client.go +++ b/iam/client.go @@ -209,7 +209,10 @@ func (c *Client) WithLogin(username, password string) (*Client, error) { } func (c *Client) accessTokenEndpoint() string { - return c.baseIAMURL.String() + "oauth2/access_token" + if c.baseIAMURL != nil { + return c.baseIAMURL.String() + "oauth2/access_token" + } + return "" } // Token returns the current token