Bug 1246614 - Check if system add-ons directory exists before trying to clean it. r=mossop
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sun, 21 Feb 2016 05:45:00 +0100
changeset 285315 49cd9160c34bdda3d494521867b53d91a9bdf874
parent 285314 046e5f381e66ba1a1d3272ccb5ceaa20e3d26df6
child 285316 35b8118cf841fcfb22823cc94db2669e4432dda7
push id17792
push usercbook@mozilla.com
push dateWed, 24 Feb 2016 15:23:03 +0000
treeherderfx-team@35b8118cf841 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1246614
milestone47.0a1
Bug 1246614 - Check if system add-ons directory exists before trying to clean it. r=mossop
toolkit/mozapps/extensions/internal/XPIProvider.jsm
--- 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;
     }