From 81d0d647319bbff1ac6c079f871afacae97c6760 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 1 Aug 2016 17:25:55 +0200 Subject: [PATCH] QtWebEngine: Fix crash when closing/reopening tabs --- qutebrowser/browser/webengine/webenginetab.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 4e0a82066..05b7bc6ac 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -211,6 +211,10 @@ class WebEngineScroller(browsertab.AbstractScroller): """Update the scroll position attributes when it changed.""" def update_scroll_pos(jsret): """Callback after getting scroll position via JS.""" + if jsret is None: + # This can happen when the callback would get called after + # shutting down a tab + return assert isinstance(jsret, dict), jsret self._pos_perc = (jsret['perc']['x'], jsret['perc']['y']) self._pos_px = QPoint(jsret['px']['x'], jsret['px']['y'])