Skip to content

Commit

Permalink
nil crash bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Feb 9, 2024
1 parent 9d78e13 commit b27176f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ func (q *Qbit) postReq(ctx context.Context, path string, values url.Values, into
func (q *Qbit) req(ctx context.Context, method, uri string, val url.Values, into interface{}, loop bool) error {
var body io.Reader

if val == nil {
val = url.Values{}
}

if method == http.MethodPost {
body = bytes.NewBufferString(val.Encode())
}
Expand Down

0 comments on commit b27176f

Please sign in to comment.