From 259c98221bbb1d14c39fb3bececbed34c12ff7d7 Mon Sep 17 00:00:00 2001 From: Brandon Beck Date: Wed, 6 Jan 2021 15:18:48 -0600 Subject: [PATCH] fixed empty connection --- connections.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/connections.go b/connections.go index fe5645f..1d57355 100644 --- a/connections.go +++ b/connections.go @@ -44,16 +44,18 @@ func (c *Client) ReadConnection(identifier string) (types.GuacConnection, error) return ret, err } - // Get connection parameters - request, err = c.CreateJSONRequest(http.MethodGet, fmt.Sprintf("%s/%s/%s/parameters", c.baseURL, connectionsBasePath, identifier), nil) + if ret.Identifier != "" { + // Get connection parameters + request, err = c.CreateJSONRequest(http.MethodGet, fmt.Sprintf("%s/%s/%s/parameters", c.baseURL, connectionsBasePath, identifier), nil) - if err != nil { - return ret, err - } + if err != nil { + return ret, err + } - err = c.Call(request, &retParams) - if err != nil { - return ret, err + err = c.Call(request, &retParams) + if err != nil { + return ret, err + } } ret.Parameters = retParams