Catch exception ValueError in number conversions
This commit is contained in:
parent
890d4fa2e1
commit
87a9710d1d
@ -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 New Issue
Block a user