Catch exception ValueError in number conversions
This commit is contained in:
parent
890d4fa2e1
commit
87a9710d1d
1 changed files with 2 additions and 2 deletions
|
@ -123,13 +123,13 @@ class Network(QtCore.QObject):
|
|||
self._server = server
|
||||
try:
|
||||
self._port = int(port)
|
||||
except:
|
||||
except ValueError:
|
||||
self._port = 0
|
||||
self._ssl = ssl
|
||||
self._password = password
|
||||
try:
|
||||
self._lines = int(lines)
|
||||
except:
|
||||
except ValueError:
|
||||
self._lines = config.CONFIG_DEFAULT_RELAY_LINES
|
||||
if self._socket.state() == QtNetwork.QAbstractSocket.ConnectedState:
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue