Skip to content

Commit

Permalink
updated with improved nil check on the set body
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxx committed Jun 29, 2023
1 parent 075d926 commit 89af755
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ovenmedia/ovenmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ovenmedia

import (
"github.com/go-resty/resty/v2"
"reflect"
)

type ovenMedia struct {
Expand Down Expand Up @@ -56,7 +57,7 @@ func (o *ovenMedia) post(url string, body interface{}) (*resty.Response, error)
r := o.restClient.R().
SetHeader("Accept", "application/json")

if body != nil {
if !reflect.ValueOf(body).IsNil() {
r.SetBody(body)
}

Expand Down

0 comments on commit 89af755

Please sign in to comment.