don't try to wrap null

This commit is contained in:
Simon Kornblith 2010-11-07 03:38:42 +00:00
parent f0ff19fd05
commit 0e46cdec10

View file

@ -77,7 +77,9 @@ Zotero.Translate.SandboxManager.prototype = {
attachTo[localKey] = function() {
var args = (passAsFirstArgument ? [passAsFirstArgument] : []);
for(var i=0; i<arguments.length; i++) {
args.push(typeof arguments[i] === "object" || typeof arguments[i] === "function" ? new XPCSafeJSObjectWrapper(arguments[i]) : arguments[i]);
args.push((typeof arguments[i] === "object" && arguments[i] !== null)
|| typeof arguments[i] === "function"
? new XPCSafeJSObjectWrapper(arguments[i]) : arguments[i]);
}
return object[localKey].apply(object, args);