Bug 787564 - Today repository cause a black display on SGS2/Otoro due to regression from bug 778079 [r=vingtetun]

This commit is contained in:
Fabrice Desré 2012-09-03 16:33:39 -07:00
parent c0293596e8
commit 5d55bf4797

View File

@ -78,9 +78,15 @@ let DOMApplicationRegistry = {
#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;