Bug 828280 - (packaged) App won't install without `developer` field in its manifest. r=fabrice
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 11 Jan 2013 06:47:00 +0100
changeset 118592 ea7baeb8f451a942c3371767c0a6950647c93cba
parent 118591 663226eaf5190c1b657d84142ee422e65c420437
child 118593 87f5c5d262ca9b51b1ac08a6ed5738832d0f6151
push id24170
push userryanvm@gmail.com
push dateSat, 12 Jan 2013 20:26:58 +0000
treeherdermozilla-central@d8599591d07c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs828280
milestone21.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 828280 - (packaged) App won't install without `developer` field in its manifest. r=fabrice
dom/apps/src/AppsUtils.jsm
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/AppsUtils.jsm
+++ b/dom/apps/src/AppsUtils.jsm
@@ -370,17 +370,18 @@ this.AppsUtils = {
       }
 
       let dev1 = aRoot1.developer;
       let dev2 = aRoot2.developer;
       if ((dev1 && !dev2) || (dev2 && !dev1)) {
         return false;
       }
 
-      return (dev1.name === dev2.name && dev1.url === dev2.url);
+      return (!dev1 && !dev2) ||
+             (dev1.name === dev2.name && dev1.url === dev2.url);
     }
 
     // 2. For each locale, check if the name and dev info are the same.
     if (!checkNameAndDev(aManifest1, aManifest2)) {
       return false;
     }
 
     for (let locale in aManifest1.locales) {
@@ -436,17 +437,19 @@ ManifestHelper.prototype = {
     return this._localeProp("version");
   },
 
   get launch_path() {
     return this._localeProp("launch_path");
   },
 
   get developer() {
-    return this._localeProp("developer");
+    // Default to {} in order to avoid exception in code
+    // that doesn't check for null `developer`
+    return this._localeProp("developer") || {};
   },
 
   get icons() {
     return this._localeProp("icons");
   },
 
   get appcache_path() {
     return this._localeProp("appcache_path");
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -2061,17 +2061,17 @@ this.DOMApplicationRegistry = {
               }
 
               if (aOnSuccess) {
                 aOnSuccess(id, manifest);
               }
             } catch (e) {
               // Something bad happened when reading the package.
               if (typeof e == 'object') {
-                debug(e);
+                Cu.reportError("Error while reading package:" + e);
                 cleanup("INVALID_PACKAGE");
               } else {
                 cleanup(e);
               }
             } finally {
               AppDownloadManager.remove(aApp.manifestURL);
               if (zipReader)
                 zipReader.close();