Bug 992589 - OperatorApps.jsm errors when running with and without Single Variant apps. r=ferjm
authorCarmen Jimenez <cjc@tid.es>
Tue, 08 Apr 2014 12:46:27 +0200
changeset 177571 33f98fa5c415b985750ee7084808a75cca514bd7
parent 177570 e9f369349de830f83d1fad868ccb3ab158380f2d
child 177572 f1e4f0f82a9a1572479ee08ed873cc61baeca0da
push id26556
push userryanvm@gmail.com
push dateTue, 08 Apr 2014 22:16:57 +0000
treeherdermozilla-central@5811efc11011 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersferjm
bugs992589
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 992589 - OperatorApps.jsm errors when running with and without Single Variant apps. r=ferjm
dom/apps/src/OperatorApps.jsm
--- a/dom/apps/src/OperatorApps.jsm
+++ b/dom/apps/src/OperatorApps.jsm
@@ -137,17 +137,18 @@ this.OperatorAppsRegistry = {
 
   _copyDirectory: function(aOrg, aDst) {
     debug("copying " + aOrg + " to " + aDst);
     return aDst && Task.spawn(function() {
       try {
         let orgDir = Cc["@mozilla.org/file/local;1"]
                        .createInstance(Ci.nsIFile);
         orgDir.initWithPath(aOrg);
-        if (!orgDir.isDirectory()) {
+        if (!orgDir.exists() || !orgDir.isDirectory()) {
+          debug(aOrg + " does not exist or is not a directory");
           return;
         }
 
         let dstDir = Cc["@mozilla.org/file/local;1"]
                        .createInstance(Ci.nsIFile);
         dstDir.initWithPath(aDst);
         if (!dstDir.exists()) {
           dstDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
@@ -163,17 +164,17 @@ this.OperatorAppsRegistry = {
             dstFile.append(entry.leafName);
             if(dstFile.exists()) {
               dstFile.remove(false);
             }
 
             entry.copyTo(dstDir, entry.leafName);
           } else {
             yield this._copyDirectory(entry.path,
-                                      Path.join(aDst, entry.name));
+                                      Path.join(aDst, entry.leafName));
           }
         }
       } catch (e) {
         debug("Error copying " + aOrg + " to " + aDst + ". " + e);
       }
     }.bind(this));
   },