From 88f66874a11ac727d607ee435d2b6971c13679eb Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Tue, 26 Apr 2016 20:52:56 -0400 Subject: [PATCH] Don't crash when setting mark on invalid url. --- qutebrowser/mainwindow/tabbedbrowser.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 5c3a029b1..ccf945738 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -656,7 +656,13 @@ class TabbedBrowser(tabwidget.TabWidget): key: mark identifier; capital indicates a global mark """ # strip the fragment as it may interfere with scrolling - url = self.current_url().adjusted(QUrl.RemoveFragment) + try: + url = self.current_url().adjusted(QUrl.RemoveFragment) + except qtutils.QtValueError: + # show an error only if the mark is not automatically set + if key != "'": + message.error(self._win_id, "Failed to set mark: url invalid") + return point = self.currentWidget().page().currentFrame().scrollPosition() if key.isupper():