fixes try to clode Body even if error is not nil
fixes: https://github.com/xsteadfastx/jitsiexporter/issues/3
This commit is contained in:
parent
bac054fa0d
commit
6f20bf101a
@ -134,8 +134,6 @@ func (c colibri) Now(url string) (map[string]interface{}, error) {
|
|||||||
case r := <-res:
|
case r := <-res:
|
||||||
err = r.Error
|
err = r.Error
|
||||||
resp = r.Resp
|
resp = r.Resp
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -148,6 +146,8 @@ func (c colibri) Now(url string) (map[string]interface{}, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user