commit 4f4be436f6f65203618d2a3bb6f088849d816420 parent e67149626058cfc12893aa68ca064ff416208d81 Author: Simon Kornblith <simon@simonster.com> Date: Sun, 3 Jul 2011 19:39:24 +0000 ...but don't try to trim null strings Diffstat:
| M | chrome/content/zotero/xpcom/translation/translate.js | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -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);