Don't crash if frame is none in mouseDownEvent
This commit is contained in:
parent
427fe0b8fb
commit
3babead395
@ -315,6 +315,10 @@ class WebView(QWebView):
|
|||||||
"""
|
"""
|
||||||
pos = e.pos()
|
pos = e.pos()
|
||||||
frame = self.page_.frameAt(pos)
|
frame = self.page_.frameAt(pos)
|
||||||
|
if frame is None:
|
||||||
|
# I don't know why this would happen, but it did.
|
||||||
|
logging.warn("Clicked at {} but frame is None!".format(pos))
|
||||||
|
return
|
||||||
pos -= frame.geometry().topLeft()
|
pos -= frame.geometry().topLeft()
|
||||||
hitresult = frame.hitTestContent(pos)
|
hitresult = frame.hitTestContent(pos)
|
||||||
if self._is_editable(hitresult):
|
if self._is_editable(hitresult):
|
||||||
|
Loading…
Reference in New Issue
Block a user