mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-10 16:28:24 +03:00
Add exception check in toURI() call
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -1201,9 +1201,19 @@ class UserServersQTableWidget(QTranslatable, AppQTableWidget):
|
||||
# Nothing selected. Do nothing
|
||||
return
|
||||
|
||||
def toURI(factory) -> str:
|
||||
assert isinstance(factory, ConfigurationFactory)
|
||||
|
||||
try:
|
||||
return factory.toURI()
|
||||
except Exception:
|
||||
# Any non-exit exceptions
|
||||
|
||||
return ''
|
||||
|
||||
# TODO: MessageBox?
|
||||
QApplication.clipboard().setText(
|
||||
'\n'.join(list(AS_UserServers()[index].toURI() for index in indexes))
|
||||
'\n'.join(list(toURI(AS_UserServers()[index]) for index in indexes))
|
||||
)
|
||||
|
||||
def exportSelectedItemQR(self):
|
||||
|
||||
@@ -57,7 +57,12 @@ class QRCodeWindow(SupportImplicitReference, AppQMainWindow):
|
||||
|
||||
config = AS_UserServers()[index]
|
||||
|
||||
uri = config.toURI()
|
||||
try:
|
||||
uri = config.toURI()
|
||||
except Exception:
|
||||
# Any non-exit exceptions
|
||||
|
||||
uri = ''
|
||||
|
||||
if uri:
|
||||
qrcode = pyqrcode.create(uri)
|
||||
|
||||
Reference in New Issue
Block a user