From 6e20d8c6930a9fd917c8adc8dd35015d2ec44063 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Apr 2022 20:49:14 +0100 Subject: [PATCH] Add error handling to getting bank details --- handler/markets.py | 2 ++ handler/ux/commands.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/handler/markets.py b/handler/markets.py index b32eee3..ff4fdc9 100644 --- a/handler/markets.py +++ b/handler/markets.py @@ -296,6 +296,8 @@ class Markets(util.Base): """ Format the payment details. """ + if not payment_details: + return False if real: payment = settings.Platform.PaymentDetailsReal else: diff --git a/handler/ux/commands.py b/handler/ux/commands.py index 3c3c007..bdce2ce 100644 --- a/handler/ux/commands.py +++ b/handler/ux/commands.py @@ -952,4 +952,7 @@ class IRCCommands(object): currency = spl[2] account_info = tx.markets.get_matching_account_details(platform, currency) bank_details = tx.markets.format_payment_details(currency, account_info, real=True) + if not bank_details: + msg("Could not get bank details.") + return msg(bank_details)