Bug 991246 - Fix "aIdsApp is undefined" error in OperatorApps.jsm. r=cjc, a=lsblakk
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Mon, 07 Apr 2014 10:42:56 -0400
changeset 192241 a3d8c7c4f462
parent 192240 9c41e6f07c3e
child 192242 bbac2a994298
push id3539
push userryanvm@gmail.com
push date2014-05-09 14:29 +0000
treeherdermozilla-beta@bbac2a994298 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjc, lsblakk
bugs991246
milestone30.0
Bug 991246 - Fix "aIdsApp is undefined" error in OperatorApps.jsm. r=cjc, a=lsblakk
dom/apps/src/OperatorApps.jsm
--- a/dom/apps/src/OperatorApps.jsm
+++ b/dom/apps/src/OperatorApps.jsm
@@ -350,21 +350,23 @@ this.OperatorAppsRegistry = {
     function normalizeCode(aCode) {
       let ncode = "" + aCode;
       while (ncode.length < 3) {
         ncode = "0" + ncode;
       }
       return ncode;
     }
 
-    return Task.spawn(function () {
+    return Task.spawn(function*() {
       let key = normalizeCode(aMcc) + "-" + normalizeCode(aMnc);
       let file = Path.join(this.appsDir.path, SINGLE_VARIANT_CONF_FILE);
       let aData = yield AppsUtils.loadJSONAsync(file);
+
       if (!aData || !(key in aData)) {
-        return;
+        return [];
       }
-      throw new Task.Result(aData[key]);
+
+      return aData[key];
     }.bind(this));
   }
 };
 
 OperatorAppsRegistry.init();