Delete message session when listener.Listen returns (#3240)

This commit is contained in:
Nikola Jokic
2024-01-25 15:12:19 +01:00
committed by GitHub
parent c00465973e
commit 728f05c844
8 changed files with 112 additions and 65 deletions
+5 -2
View File
@@ -640,8 +640,11 @@ func (c *Client) doSessionRequest(ctx context.Context, method, path string, requ
return err
}
if resp.StatusCode == expectedResponseStatusCode && responseUnmarshalTarget != nil {
return json.NewDecoder(resp.Body).Decode(responseUnmarshalTarget)
if resp.StatusCode == expectedResponseStatusCode {
if responseUnmarshalTarget != nil {
return json.NewDecoder(resp.Body).Decode(responseUnmarshalTarget)
}
return nil
}
if resp.StatusCode >= 400 && resp.StatusCode < 500 {