Bug 1246614 - Check if system add-ons directory exists before trying to clean it. r=mossop
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -7965,16 +7965,22 @@ Object.assign(SystemAddonInstallLocation
},
/**
* Removes any directories not currently in use or pending use after a
* restart. Any errors that happen here don't really matter as we'll attempt
* to cleanup again next time.
*/
cleanDirectories: Task.async(function*() {
+
+ // System add-ons directory does not exist
+ if (!(yield OS.File.exists(this._baseDir.path))) {
+ return;
+ }
+
let iterator;
try {
iterator = new OS.File.DirectoryIterator(this._baseDir.path);
}
catch (e) {
logger.error("Failed to clean updated system add-ons directories.", e);
return;
}