add a fix for when users input a value when no vouchers exist
This commit is contained in:
parent
62eb132b32
commit
a270079008
@ -159,6 +159,10 @@ func GetOrderedVoucherData(ctx context.Context, store DataStore, sessionId strin
|
|||||||
|
|
||||||
// MatchVoucher finds the matching voucher symbol, balance, decimals and contract address based on the input.
|
// MatchVoucher finds the matching voucher symbol, balance, decimals and contract address based on the input.
|
||||||
func MatchVoucher(input, symbols, balances, decimals, addresses string) (symbol, balance, decimal, address string) {
|
func MatchVoucher(input, symbols, balances, decimals, addresses string) (symbol, balance, decimal, address string) {
|
||||||
|
// case for invalid input with no current symbols
|
||||||
|
if symbols == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
symList := strings.Split(symbols, "\n")
|
symList := strings.Split(symbols, "\n")
|
||||||
balList := strings.Split(balances, "\n")
|
balList := strings.Split(balances, "\n")
|
||||||
decList := strings.Split(decimals, "\n")
|
decList := strings.Split(decimals, "\n")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user