fix: handle empty response request.
This commit is contained in:
parent
6fa35aeb47
commit
0ade546b76
1 changed files with 4 additions and 0 deletions
|
|
@ -321,6 +321,10 @@ func (c *Config) HandlerTorrentsMaindata(r *http.Request) (*http.Response, error
|
|||
|
||||
callback := func(c *Config, resp *http.Response) error {
|
||||
|
||||
if resp.Request == nil {
|
||||
return errors.New("empty request attached to response")
|
||||
}
|
||||
|
||||
instance := resp.Request.Context().Value(qbittorrent.ContextKeyInstance).(*qbittorrent.Instance)
|
||||
if instance == nil {
|
||||
return errors.New("empty instance")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue