fix: handle empty response request.

This commit is contained in:
William Floyd 2025-02-07 02:24:23 +05:30
parent 6fa35aeb47
commit 0ade546b76
Signed by untrusted user who does not match committer: william
GPG key ID: B3EEEDD81893CAF9

View file

@ -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")