mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Check if the response body is nil before panicing (#4448)
If a WebSocket connection couldn't be established, a panic would occur.
This commit is contained in:
@@ -130,6 +130,9 @@ func (c *Client) provisionerJobLogsAfter(ctx context.Context, path string, after
|
||||
CompressionMode: websocket.CompressionDisabled,
|
||||
})
|
||||
if err != nil {
|
||||
if res == nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return nil, nil, readBodyAsError(res)
|
||||
}
|
||||
logs := make(chan ProvisionerJobLog)
|
||||
|
||||
Reference in New Issue
Block a user