Bug 834618 - Catch any error thrown from resolveFromOrigin. r=fabrice

This commit is contained in:
Julien Wajsberg 2013-02-04 14:59:32 +01:00
parent 9ba4883ad2
commit 805b871ccd

View File

@ -461,7 +461,15 @@ this.DOMApplicationRegistry = {
let messageName; let messageName;
if (typeof(aMessage) === "object" && Object.keys(aMessage).length === 1) { if (typeof(aMessage) === "object" && Object.keys(aMessage).length === 1) {
messageName = Object.keys(aMessage)[0]; messageName = Object.keys(aMessage)[0];
href = Services.io.newURI(manifest.resolveFromOrigin(aMessage[messageName]), null, null); let uri;
try {
uri = manifest.resolveFromOrigin(aMessage[messageName]);
} catch(e) {
debug("system message url (" + aMessage[messageName] + ") is invalid, skipping. " +
"Error is: " + e);
return;
}
href = Services.io.newURI(uri, null, null);
} else { } else {
messageName = aMessage; messageName = aMessage;
} }
@ -506,7 +514,17 @@ this.DOMApplicationRegistry = {
if (!description.href) { if (!description.href) {
description.href = manifest.launch_path; description.href = manifest.launch_path;
} }
description.href = manifest.resolveFromOrigin(description.href);
try {
description.href = manifest.resolveFromOrigin(description.href);
} catch (e) {
debug("Activity href (" + description.href + ") is invalid, skipping. " +
"Error is: " + e);
continue;
}
debug('_createActivitiesToRegister: ' + aApp.manifestURL + ', activity ' +
activity + ', description.href is ' + description.href);
if (aRunUpdate) { if (aRunUpdate) {
activitiesToRegister.push({ "manifest": aApp.manifestURL, activitiesToRegister.push({ "manifest": aApp.manifestURL,