add a fix for when users input a value when no vouchers exist

This commit is contained in:
Alfred Kamanda 2026-02-23 16:15:12 +03:00
parent 62eb132b32
commit a270079008
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -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.
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")
balList := strings.Split(balances, "\n")
decList := strings.Split(decimals, "\n")