Don't crash when setting mark on invalid url.

This commit is contained in:
Ryan Roden-Corrent 2016-04-26 20:52:56 -04:00
parent fd20b46b33
commit 88f66874a1

View File

@ -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():