Bug 561480 - Errors when loading WeaveCrypto.js on older platforms [r=mconnor]

Only register WeaveCrypto if it was able to import scripts.
This commit is contained in:
Edward Lee 2010-05-04 12:15:43 -07:00
parent 0c62a45494
commit b3b91dc181

View File

@ -40,8 +40,11 @@ const Ci = Components.interfaces;
const Cr = Components.results;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/ctypes.jsm");
try {
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/ctypes.jsm");
}
catch(ex) {}
function WeaveCrypto() {
this.init();
@ -1120,7 +1123,7 @@ WeaveCrypto.prototype = {
}
};
let component = [WeaveCrypto];
let component = Services == null || ctypes == null ? [] : [WeaveCrypto];
function NSGetModule (compMgr, fileSpec) {
return XPCOMUtils.generateModule(component);
}