don't try set filter if webview already deleted

https://anki.tenderapp.com/discussions/add-ons/32496-add-on-error
This commit is contained in:
Damien Elmes 2019-04-21 19:12:04 +10:00
parent 1fc480e8f4
commit eef86bf37e

View File

@ -348,14 +348,14 @@ body {{ zoom: {}; background: {}; {} }}
return False return False
def _onBridgeCmd(self, cmd): def _onBridgeCmd(self, cmd):
if not self._filterSet:
self.focusProxy().installEventFilter(self)
self._filterSet = True
if self._shouldIgnoreWebEvent(): if self._shouldIgnoreWebEvent():
print("ignored late bridge cmd", cmd) print("ignored late bridge cmd", cmd)
return return
if not self._filterSet:
self.focusProxy().installEventFilter(self)
self._filterSet = True
if cmd == "domDone": if cmd == "domDone":
self._domDone = True self._domDone = True
self._maybeRunActions() self._maybeRunActions()