Bug 1081702 - Check that callback parameters are defined before pushing onto result arrays. r=Mossop, a=sledru
authorIrving Reid <irving@mozilla.com>
Tue, 21 Oct 2014 12:05:24 -0400
changeset 218108 f7b82b004588
parent 218105 b3ce9237bb9a
child 218109 e890ed642ccc
push id543
push userryanvm@gmail.com
push date2014-10-23 12:26 +0000
treeherdermozilla-release@e890ed642ccc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop, sledru
bugs1081702
milestone33.0.1
Bug 1081702 - Check that callback parameters are defined before pushing onto result arrays. r=Mossop, a=sledru
toolkit/mozapps/extensions/AddonManager.jsm
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -1754,17 +1754,19 @@ var AddonManagerInternal = {
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let installs = [];
 
     new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
       nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) {
         callProviderAsync(aProvider, "getInstallsByTypes", aTypes,
                           function getInstallsByTypes_safeCall(aProviderInstalls) {
-          installs = installs.concat(aProviderInstalls);
+          if (aProviderInstalls) {
+            installs = installs.concat(aProviderInstalls);
+          }
           aCaller.callNext();
         });
       },
 
       noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) {
         safeCall(aCallback, installs);
       }
     });
@@ -2126,17 +2128,19 @@ var AddonManagerInternal = {
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
       nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) {
         callProviderAsync(aProvider, "getAddonsByTypes", aTypes,
                           function getAddonsByTypes_concatAddons(aProviderAddons) {
-          addons = addons.concat(aProviderAddons);
+          if (aProviderAddons) {
+            addons = addons.concat(aProviderAddons);
+          }
           aCaller.callNext();
         });
       },
 
       noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) {
         safeCall(aCallback, addons);
       }
     });
@@ -2187,17 +2191,19 @@ var AddonManagerInternal = {
     let addons = [];
 
     new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
       nextObject: function getAddonsWithOperationsByTypes_nextObject
                            (aCaller, aProvider) {
         callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes,
                           function getAddonsWithOperationsByTypes_concatAddons
                                    (aProviderAddons) {
-          addons = addons.concat(aProviderAddons);
+          if (aProviderAddons) {
+            addons = addons.concat(aProviderAddons);
+          }
           aCaller.callNext();
         });
       },
 
       noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) {
         safeCall(aCallback, addons);
       }
     });