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