Bug 895489 - Fix webapprt-test-chrome warnings. r=fabrice
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Fri, 19 Jul 2013 10:14:22 -0400
changeset 151517 077d190b7ab3211fadb21e499d771209ff042a86
parent 151516 424edce8ad29ac522af2301c2c7ed94b80b435bf
child 151518 b7fbc6770e37b28bc42a79e0dc6c1f3d91d5669e
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs895489
milestone25.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 895489 - Fix webapprt-test-chrome warnings. r=fabrice
dom/apps/src/AppDownloadManager.jsm
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/AppDownloadManager.jsm
+++ b/dom/apps/src/AppDownloadManager.jsm
@@ -54,16 +54,19 @@ this.AppDownloadManager = {
 
   /**
    * Retrieves a download from the list of current downloads.
    * @param  aManifestURL The manifest URL for the application being retrieved.
    * @return              The opaque object representing the download.
    */
   get: function app_dlMgr_get(aManifestURL) {
     debug("Getting " + aManifestURL);
+    if (!this.downloads[aManifestURL]) {
+      return null;
+    }
     return this.downloads[aManifestURL];
   },
 
   /**
    * Removes a download of the list of current downloads.
    * @param aManifestURL The manifest URL for the application being removed.
    */
   remove: function app_dlMgr_remove(aManifestURL) {
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -2784,17 +2784,19 @@ this.DOMApplicationRegistry = {
     } catch (e) {}
 
     delete this.webapps[id];
 
     this._saveApps((function() {
       this.broadcastMessage("Webapps:Uninstall:Broadcast:Return:OK", appClone);
       // Catch exception on callback call to ensure notifying observers after
       try {
-        aOnSuccess();
+        if (aOnSuccess) {
+          aOnSuccess();
+        }
       } catch(ex) {
         Cu.reportError("DOMApplicationRegistry: Exception on app uninstall: " +
                        ex + "\n" + ex.stack);
       }
       Services.obs.notifyObservers(this, "webapps-sync-uninstall", JSON.stringify(appClone));
       this.broadcastMessage("Webapps:RemoveApp", { id: id });
     }).bind(this));
   },