engine/okgroup: fix panic when calling GetDepositAddress() (#858)

* engine/okgroup: fix caller panic and patched for re-occurance

* engine/helpers: remove nil check as it was not neccessary.
This commit is contained in:
Ryan O'Hara-Reid
2021-12-16 09:43:50 +11:00
committed by GitHub
parent 5aee88c7c5
commit 19b76bf2e2
2 changed files with 11 additions and 7 deletions

View File

@@ -691,10 +691,7 @@ func (bot *Engine) GetCryptocurrencyDepositAddressesByExchange(exchName string)
func (bot *Engine) GetExchangeCryptocurrencyDepositAddress(ctx context.Context, exchName, accountID, chain string, item currency.Code, bypassCache bool) (*deposit.Address, error) {
if bot.DepositAddressManager != nil && bot.DepositAddressManager.IsSynced() && !bypassCache {
resp, err := bot.DepositAddressManager.GetDepositAddressByExchangeAndCurrency(exchName, chain, item)
if err != nil {
return nil, err
}
return &resp, nil
return &resp, err
}
exch, err := bot.GetExchangeByName(exchName)
if err != nil {