From be0cd9625f44fb945393515169c311c9d3b0336c Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Thu, 11 Jun 2020 17:22:40 +0000 Subject: [PATCH] Bug 1644913 - Avoid exceptions if the storage actor is destroyed while processing a new window r=ochameau Differential Revision: https://phabricator.services.mozilla.com/D79276 --- devtools/server/actors/storage.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devtools/server/actors/storage.js b/devtools/server/actors/storage.js index fb64071ceff0..faa00d5d1d79 100644 --- a/devtools/server/actors/storage.js +++ b/devtools/server/actors/storage.js @@ -276,6 +276,11 @@ StorageActors.defaults = function(typeName, observationTopics) { const host = this.getHostName(window.location); if (host && !this.hostVsStores.has(host)) { await this.populateStoresForHost(host, window); + if (!this.storageActor) { + // The actor might be destroyed during populateStoresForHost. + return; + } + const data = {}; data[host] = this.getNamesForHost(host); this.storageActor.update("added", typeName, data);