Skip to content

Commit

Permalink
Merge pull request #6829 from drew2a/fix/6112
Browse files Browse the repository at this point in the history
Add NPE check to handle_uri
  • Loading branch information
drew2a authored Mar 24, 2022
2 parents fccf4fa + bad50e8 commit 27b27e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tribler/gui/tribler_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@

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

# 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):
"""
Expand All @@ -32,6 +33,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()
Expand Down

0 comments on commit 27b27e6

Please sign in to comment.