fix nil ptr dereference

fix bug in transfers
This commit is contained in:
Niko Storni 2019-10-12 09:49:49 +02:00
parent a9e76149e8
commit 10a855a8ba
2 changed files with 9 additions and 7 deletions

View file

@ -124,12 +124,14 @@ func (a *APIConfig) SetChannelCert(certHex string, channelID string) error {
endpoint := a.ApiURL + "/yt/channel_cert"
res, _ := http.PostForm(endpoint, url.Values{
res, err := http.PostForm(endpoint, url.Values{
"channel_claim_id": {channelID},
"channel_cert": {certHex},
"auth_token": {a.ApiToken},
})
if err != nil {
return errors.Err(err)
}
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)