From 7bb4700352ec76aee1b7e8f41e50e8192dfc547d Mon Sep 17 00:00:00 2001 From: Kevin Velghe Date: Thu, 18 Aug 2016 23:37:39 +0200 Subject: [PATCH 1/2] Return None when parent is a null webelement --- qutebrowser/browser/webkit/webkitelem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/webkit/webkitelem.py b/qutebrowser/browser/webkit/webkitelem.py index b0ee4f89c..6ce4e9292 100644 --- a/qutebrowser/browser/webkit/webkitelem.py +++ b/qutebrowser/browser/webkit/webkitelem.py @@ -148,7 +148,7 @@ class WebKitElement(webelem.AbstractWebElement): def parent(self): self._check_vanished() elem = self._elem.parent() - if elem is None: + if elem is None or elem.isNull(): return None return WebKitElement(elem, tab=self._tab) From 97493b71ad060f59ddd94b8d9293fcfabf9dc512 Mon Sep 17 00:00:00 2001 From: Kevin Velghe Date: Mon, 17 Oct 2016 15:23:22 +0200 Subject: [PATCH 2/2] Add test for null element --- tests/end2end/features/hints.feature | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index d0622b9c0..0f44adff4 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -180,6 +180,11 @@ Feature: Using hints - data/hints/iframe_target.html - data/hello.txt (active) + Scenario: Clicking on iframe with :hint all current + When I open data/hints/iframe.html + And I hint with args "all current" and follow a + Then no crash should happen + ### hints -> auto-follow-timeout @not_osx