Skip to content

Commit

Permalink
fixed empty connection
Browse files Browse the repository at this point in the history
  • Loading branch information
techBeck03 committed Jan 6, 2021
1 parent 905723a commit 259c982
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 259c982

Please sign in to comment.