Bug 787564 - Today repository cause a black display on SGS2/Otoro due to regression from bug 778079 [r=vingtetun]
authorFabrice Desré <fabrice@mozilla.com>
Mon, 03 Sep 2012 16:33:39 -0700
changeset 104165 a86b00fa6bc6
parent 104164 eeda05ede83f
child 104166 933e1cf85511
child 110931 597ea0e0cf7e
push id23401
push userryanvm@gmail.com
push dateTue, 04 Sep 2012 00:56:56 +0000
treeherdermozilla-central@a86b00fa6bc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs787564, 778079
milestone18.0a1
first release with
nightly linux32
a86b00fa6bc6 / 18.0a1 / 20120904030512 / files
nightly linux64
a86b00fa6bc6 / 18.0a1 / 20120904030512 / files
nightly mac
a86b00fa6bc6 / 18.0a1 / 20120904030512 / files
nightly win32
a86b00fa6bc6 / 18.0a1 / 20120904030512 / files
nightly win64
a86b00fa6bc6 / 18.0a1 / 20120904030512 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 787564 - Today repository cause a black display on SGS2/Otoro due to regression from bug 778079 [r=vingtetun]
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -73,19 +73,25 @@ let DOMApplicationRegistry = {
 
     let dirList = [DIRECTORY_NAME];
 
 #ifdef MOZ_WIDGET_GONK
     dirList.push("coreAppsDir");
 #endif
     let currentId = 1;
     dirList.forEach((function(dir) {
-      let curFile = FileUtils.getFile(dir, ["webapps", "webapps.json"], true);
-      if (curFile.exists()) {
-        let appDir = FileUtils.getDir(dir, ["webapps"]);
+      let curFile;
+      try {
+        // getFile calls getDir with |shouldCreate = true|, so we have
+        // to wrap in a try..catch in case the file does not exist on a
+        // read-only partition.
+        curFile = FileUtils.getFile(dir, ["webapps", "webapps.json"], false);
+      } catch(e) { }
+      if (curFile && curFile.exists()) {
+        let appDir = FileUtils.getDir(dir, ["webapps"], false);
         this._loadJSONAsync(curFile, (function(aData) {
           if (!aData) {
             return;
           }
           // Add new apps to the merged list.
           for (let id in aData) {
             this.webapps[id] = aData[id];
             this.webapps[id].basePath = appDir.path;