From f892671a1801ae969ddf6224c7ce836572b514a2 Mon Sep 17 00:00:00 2001 From: Michael Wozniak Date: Sat, 16 Nov 2013 10:09:48 -0500 Subject: [PATCH] point of sale plugin set amount to None if the exchanger fails --- plugins/pointofsale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/pointofsale.py b/plugins/pointofsale.py index 6e661421..f08bb1c2 100644 --- a/plugins/pointofsale.py +++ b/plugins/pointofsale.py @@ -65,7 +65,10 @@ class QR_Window(QWidget): amount_text = '' if amount: if currency: - self.amount = Decimal(amount) / self.exchanger.exchange(1, currency) if currency else amount + try: + self.amount = Decimal(amount) / self.exchanger.exchange(1, currency) if currency else amount + except Exception: + self.amount = None else: self.amount = Decimal(amount) self.amount = self.amount.quantize(Decimal('1.0000'))