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
|
self._server = server
|
||||||
try:
|
try:
|
||||||
self._port = int(port)
|
self._port = int(port)
|
||||||
except:
|
except ValueError:
|
||||||
self._port = 0
|
self._port = 0
|
||||||
self._ssl = ssl
|
self._ssl = ssl
|
||||||
self._password = password
|
self._password = password
|
||||||
try:
|
try:
|
||||||
self._lines = int(lines)
|
self._lines = int(lines)
|
||||||
except:
|
except ValueError:
|
||||||
self._lines = config.CONFIG_DEFAULT_RELAY_LINES
|
self._lines = config.CONFIG_DEFAULT_RELAY_LINES
|
||||||
if self._socket.state() == QtNetwork.QAbstractSocket.ConnectedState:
|
if self._socket.state() == QtNetwork.QAbstractSocket.ConnectedState:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue