From a9a0f26862975d489a56aa54f2eebeec1aeef03c Mon Sep 17 00:00:00 2001 From: Andrei Andreev Date: Wed, 23 Mar 2022 13:31:30 +0100 Subject: [PATCH 1/2] Add NPE check to handle_uri --- src/tribler/gui/tribler_app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tribler/gui/tribler_app.py b/src/tribler/gui/tribler_app.py index 592e008a0ec..668d770ea9a 100644 --- a/src/tribler/gui/tribler_app.py +++ b/src/tribler/gui/tribler_app.py @@ -32,6 +32,9 @@ def on_app_message(self, msg): self.handle_uri(msg) def handle_uri(self, uri): + if not self.activation_window(): + return + self.activation_window().pending_uri_requests.append(uri) if self.activation_window().tribler_started and not self.activation_window().start_download_dialog_active: self.activation_window().process_uri_request() From bad50e8a2254f60431faf25e9709cea1b770458e Mon Sep 17 00:00:00 2001 From: Andrei Andreev Date: Wed, 23 Mar 2022 13:35:48 +0100 Subject: [PATCH 2/2] Flake --- src/tribler/gui/tribler_app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tribler/gui/tribler_app.py b/src/tribler/gui/tribler_app.py index 668d770ea9a..093d9d2c610 100644 --- a/src/tribler/gui/tribler_app.py +++ b/src/tribler/gui/tribler_app.py @@ -6,7 +6,6 @@ from tribler.core.utilities.rest_utils import path_to_uri from tribler.core.utilities.unicode import ensure_unicode - from tribler.gui.code_executor import CodeExecutor from tribler.gui.single_application import QtSingleApplication from tribler.gui.utilities import connect @@ -14,8 +13,10 @@ # Set the QT application parameters before creating any instances of the application. QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps) QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) -os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = "1" +os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" + +# fmt: off class TriblerApplication(QtSingleApplication): """