Bug 1042919: Catch errors in isPlatformCompatible and report them via Telemetry; r=mossop

This commit is contained in:
Irving Reid 2014-08-28 09:22:52 -04:00
parent 0e0ad75589
commit 4759183a0e

View File

@ -6133,17 +6133,27 @@ AddonInternal.prototype = {
}
catch (e) { }
for (let platform of this.targetPlatforms) {
if (platform.os == Services.appinfo.OS) {
if (platform.abi) {
needsABI = true;
if (platform.abi === abi)
return true;
}
else {
matchedOS = true;
// Something is causing errors in here
try {
for (let platform of this.targetPlatforms) {
if (platform.os == Services.appinfo.OS) {
if (platform.abi) {
needsABI = true;
if (platform.abi === abi)
return true;
}
else {
matchedOS = true;
}
}
}
} catch (e) {
let message = "Problem with addon " + this.id + " targetPlatforms "
+ JSON.stringify(this.targetPlatforms);
logger.error(message, e);
AddonManagerPrivate.recordException("XPI", message, e);
// don't trust this add-on
return false;
}
return matchedOS && !needsABI;