From 93b81f2e2ecdc8b0bd7f9345033694384279b50a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 21 Oct 2022 10:19:30 +0200 Subject: Fix crashe with no current tab in _run_userscript Not sure why this was a FIXME instead of handling it properly in the first place... --- doc/changelog.asciidoc | 1 + qutebrowser/browser/commands.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b9c4e7a15..79641c7cb 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -118,6 +118,7 @@ Fixed when only the text matches. - The `progress` and `backforward` statusbar widgets now stay removed if you choose to remove them. Previously they would appear again on navigation. +- Rare crash when running userscripts with crashed renderer processes. [[v2.5.3]] v2.5.3 (unreleased) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index b537b05f4..6cbfc169c 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1191,8 +1191,9 @@ class CommandDispatcher: env['QUTE_TAB_INDEX'] = str(idx + 1) env['QUTE_TITLE'] = self._tabbed_browser.widget.page_title(idx) - # FIXME:qtwebengine: If tab is None, run_async will fail! tab = self._tabbed_browser.widget.currentWidget() + if tab is None: + raise cmdutils.CommandError("No current tab!") try: url = self._tabbed_browser.current_url() -- cgit v1.2.3-54-g00ecf