nill response from Trades
drakos74 opened this issue · 1 comments
drakos74 commented
Sometimes lately, when making a Trades request i am getting the following error
panic: interface conversion: interface {} is nil, not []interface {}
goroutine 56 [running]:
github.com/beldur/kraken-go-api-client.(*KrakenAPI).Trades(0xc00007dda0, 0x9a6067, 0x6, 0x1663c1ef0f0ae825, 0x0, 0x0, 0x0)
/home/ec2-user/Projects/free-coin/vendor/github.com/beldur/kraken-go-api-client/krakenapi.go:251 +0xa30
It seems it would be better to do a nil check, before casting the response ...
if v[pair] == nil {
return nil, err
}
trades := v[pair].([]interface{})
Would it make sense to create a PR for this fix ?
Did anyone else encounter this one ?
beldur commented
Hi drakos74, a pull request would be appreciated.