Bug 1484764 - Prevent netmonitors is undefined exception when closing tools during page load. r=Honza

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2018-08-21 17:06:19 +00:00
parent 28c6b4ddec
commit 740bef2e99

View File

@ -1495,6 +1495,11 @@ WebConsoleActor.prototype =
return new Promise(resolve => {
let messagesReceived = 0;
const onMessage = ({ data }) => {
// Resolve early if the console actor is destroyed
if (!this.netmonitors) {
resolve(null);
return;
}
if (data.url != url) {
return;
}