get_amount returns None if there's an exception
authorThomasV <thomasv@gitorious>
Thu, 12 Jun 2014 07:15:25 +0000 (09:15 +0200)
committerThomasV <thomasv@gitorious>
Thu, 12 Jun 2014 07:15:25 +0000 (09:15 +0200)
gui/qt/main_window.py

index 97df77d..d501300 100644 (file)
@@ -816,9 +816,8 @@ class ElectrumWindow(QMainWindow):
 
         amount = sum(map(lambda x:x[1], outputs))
 
-        try:
-            fee = self.fee_e.get_amount()
-        except Exception:
+        fee = self.fee_e.get_amount()
+        if fee is None:
             QMessageBox.warning(self, _('Error'), _('Invalid Fee'), _('OK'))
             return
 
@@ -2303,9 +2302,8 @@ class ElectrumWindow(QMainWindow):
         # run the dialog
         if not d.exec_(): return
 
-        try:
-            fee = self.fee_e.get_amount()
-        except Exception:
+        fee = self.fee_e.get_amount()
+        if fee is None:
             QMessageBox.warning(self, _('Error'), _('Invalid value') +': %s'%fee, _('OK'))
             return