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
This commit is contained in:
Julian Descottes 2020-06-11 17:22:40 +00:00
Родитель 532a47e62b
Коммит be0cd9625f
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -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);