Bug 1621337 - Check if existingTargets is still defined when processing listWorkerChanged r=ochameau

Differential Revision: https://phabricator.services.mozilla.com/D74699
This commit is contained in:
Julian Descottes 2020-05-22 06:46:31 +00:00
Родитель 8a87d1b582
Коммит 0eaaeb886a
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -82,6 +82,10 @@ class LegacyWorkersWatcher {
// Fetch the list of already existing worker targets for this process target front. // Fetch the list of already existing worker targets for this process target front.
const existingTargets = this.targetsByProcess.get(targetFront); const existingTargets = this.targetsByProcess.get(targetFront);
if (!existingTargets) {
// unlisten was called while processing the workerListChanged callback.
return;
}
// Process the new list to detect the ones being destroyed // Process the new list to detect the ones being destroyed
// Force destroying the targets // Force destroying the targets