From df2d5bce4c31c9bdb95bb34d5aced550dcca2805 Mon Sep 17 00:00:00 2001 From: Justin Ramos Date: Wed, 11 Jan 2017 18:11:16 +0000 Subject: [PATCH] ensure we have an integer for maxoutboundconnections when setting --- src/bitmessageqt/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 5ca1064b..a2f41abe 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2418,8 +2418,14 @@ class MyForm(settingsmixin.SMainWindow): QMessageBox.about(self, _translate("MainWindow", "Number needed"), _translate( "MainWindow", "Your maximum download and upload rate must be numbers. Ignoring what you typed.")) - shared.config.set('bitmessagesettings', 'maxoutboundconnections', str( - self.settingsDialogInstance.ui.lineEditMaxOutboundConnections.text())) + try: + # Ensure we have an integer + shared.config.set('bitmessagesettings', 'maxoutboundconnections', str( + int(float(self.settingsDialogInstance.ui.lineEditMaxOutboundConnections.text())))) + except: + QMessageBox.about(self, _translate("MainWindow", "Number needed"), _translate( + "MainWindow", "Your maximum outbound connections must be a number. Ignoring what you typed.")) + shared.config.set('bitmessagesettings', 'namecoinrpctype', self.settingsDialogInstance.getNamecoinType()) shared.config.set('bitmessagesettings', 'namecoinrpchost', str(