...but don't try to trim null strings

This commit is contained in:
Simon Kornblith 2011-07-03 19:39:24 +00:00
parent e671496260
commit 4f4be436f6

View file

@ -93,8 +93,11 @@ Zotero.Translate.Sandbox = {
if(translate._libraryID === false || translate._parentTranslator) {
// remove null, undefined, and false properties
for(var i in item) {
if(!item[i] && item[i] !== 0) delete item[i];
if(typeof item[i] === "string") item[i] = item[i].trim();
if(!item[i] && item[i] !== 0) {
delete item[i];
} else if(typeof item[i] === "string") {
item[i] = item[i].trim();
}
}
translate.newItems.push(item);