Bug 1526928 - Check for TabParent destruction before trying to send a message on it. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D26830

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2019-04-10 18:40:42 +00:00
Родитель 22cffe9c10
Коммит d45de3307d
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -1358,7 +1358,10 @@ class SynthesizedEventObserver : public nsIObserver {
return NS_OK;
}
if (!mTabParent->SendNativeSynthesisResponse(mObserverId,
if (mTabParent->IsDestroyed()) {
// If this happens it's probably a bug in the test that's triggering this.
NS_WARNING("TabParent was unexpectedly destroyed during event synthesization!");
} else if (!mTabParent->SendNativeSynthesisResponse(mObserverId,
nsCString(aTopic))) {
NS_WARNING("Unable to send native event synthesization response!");
}