Fix crashes with downloads in a closed tab.
When a download was redirected or failed after a tab was closed, there was a
KeyError in the object registry.
Fixes #889. This is a regression introduced in
976f758da1
/ #731.
This commit is contained in:
parent
89c0ff0d9b
commit
b59a56921e
@ -363,8 +363,13 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
if self._tab_id is None:
|
if self._tab_id is None:
|
||||||
current_url = QUrl() # generic NetworkManager, e.g. for downloads
|
current_url = QUrl() # generic NetworkManager, e.g. for downloads
|
||||||
else:
|
else:
|
||||||
webview = objreg.get('webview', scope='tab', window=self._win_id,
|
try:
|
||||||
tab=self._tab_id)
|
webview = objreg.get('webview', scope='tab',
|
||||||
|
window=self._win_id, tab=self._tab_id)
|
||||||
|
except KeyError:
|
||||||
|
# https://github.com/The-Compiler/qutebrowser/issues/889
|
||||||
|
current_url = QUrl()
|
||||||
|
else:
|
||||||
current_url = webview.url()
|
current_url = webview.url()
|
||||||
|
|
||||||
self.set_referer(req, current_url)
|
self.set_referer(req, current_url)
|
||||||
|
Loading…
Reference in New Issue
Block a user