greasemonkey: check _widget is not deleted

Just for good luck.

No crash has been reported here but it is a common pattern for functions
called from signals.
This commit is contained in:
Jimmy 2018-06-26 14:45:38 +12:00
parent 6f1232e621
commit ee2c765859

View File

@ -908,6 +908,9 @@ class _WebEngineScripts(QObject):
remove_first: Whether to remove all previously injected
scripts before adding these ones.
"""
if sip.isdeleted(self._widget):
return
# Since we are inserting scripts into a per-tab collection,
# rather than just injecting scripts on page load, we need to
# make sure we replace existing scripts, not just add new ones.