1
0

network: handle unparseable server-str

follow-up 9e57ae630b

fixes #6113
This commit is contained in:
SomberNight
2020-04-25 06:53:25 +02:00
parent 56a9ccca6d
commit bf223470ce
2 changed files with 2 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ class ElectrumWindow(App):
net_params = self.network.get_parameters() net_params = self.network.get_parameters()
try: try:
server = ServerAddr.from_str_with_inference(server_str) server = ServerAddr.from_str_with_inference(server_str)
if not server: raise Exception("failed to parse")
except Exception as e: except Exception as e:
self.show_error(_("Invalid server details: {}").format(repr(e))) self.show_error(_("Invalid server details: {}").format(repr(e)))
return return

View File

@@ -428,6 +428,7 @@ class NetworkChoiceLayout(object):
net_params = self.network.get_parameters() net_params = self.network.get_parameters()
try: try:
server = ServerAddr.from_str_with_inference(str(self.server_e.text())) server = ServerAddr.from_str_with_inference(str(self.server_e.text()))
if not server: raise Exception("failed to parse")
except Exception: except Exception:
return return
net_params = net_params._replace(server=server, net_params = net_params._replace(server=server,