fixes try to clode Body even if error is not nil

fixes: https://github.com/xsteadfastx/jitsiexporter/issues/3
master
Marvin Steadfast 4 years ago
parent bac054fa0d
commit 6f20bf101a

@ -134,8 +134,6 @@ func (c colibri) Now(url string) (map[string]interface{}, error) {
case r := <-res:
err = r.Error
resp = r.Resp
defer resp.Body.Close()
}
if err != nil {
@ -148,6 +146,8 @@ func (c colibri) Now(url string) (map[string]interface{}, error) {
return nil, err
}
defer resp.Body.Close()
return s, nil
}

Loading…
Cancel
Save