Don't crash if frame is none in mouseDownEvent

This commit is contained in:
Florian Bruhin 2014-05-01 21:35:24 +02:00
parent 427fe0b8fb
commit 3babead395

View File

@ -315,6 +315,10 @@ class WebView(QWebView):
"""
pos = e.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()
hitresult = frame.hitTestContent(pos)
if self._is_editable(hitresult):