Bug 1795801 - Avoid logspam due to xpcshell tests without any system addon set throwing from cleanupStatingDir. r=willdurand

Not actually related to the change that the bug is tracking, but I did notice this an unexpected error
that was spamming the logs while I was investigating failures from one of the event pages / persistent
listeners tests as part of the rework of the persistent listeners data written in the XPIStates JSONFile.

Depends on D171769

Differential Revision: https://phabricator.services.mozilla.com/D171770
This commit is contained in:
Luca Greco 2023-03-23 11:19:07 +00:00
parent 5c096e2607
commit aaafd0da16

View file

@ -3231,6 +3231,12 @@ class DirectoryInstaller {
cleanStagingDir(aLeafNames = []) {
let dir = this.getStagingDir();
// SystemAddonInstaller getStatingDir may return null if there isn't
// any addon set directory returned by SystemAddonInstaller._loadAddonSet.
if (!dir) {
return;
}
for (let name of aLeafNames) {
let file = getFile(name, dir);
recursiveRemove(file);