summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-10-21 10:19:30 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-10-21 10:31:18 +0200
commit93b81f2e2ecdc8b0bd7f9345033694384279b50a (patch)
tree35983a7088072c85ffff8e0bb425b23b3b0dedb6
parenta4083e005aa25a7fe418f8cc1c7aa87a3b37f210 (diff)
downloadqutebrowser-93b81f2e2ecdc8b0bd7f9345033694384279b50a.tar.gz
qutebrowser-93b81f2e2ecdc8b0bd7f9345033694384279b50a.zip
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...
-rw-r--r--doc/changelog.asciidoc1
-rw-r--r--qutebrowser/browser/commands.py3
2 files changed, 3 insertions, 1 deletions
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()