www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit d34f3b4ed7a1ac43516d9a594f616c53572198ee
parent 2ecc50f7005f0858b2beb9e75a06b788b1aaeaf7
Author: Simon Kornblith <simon@simonster.com>
Date:   Sat, 26 May 2012 19:30:49 -0400

Don't fail with error when item.note is missing

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate_item.js | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -105,7 +105,7 @@ Zotero.Translate.ItemSaver.prototype = { if(type == "note") { // handle notes differently newItem = new Zotero.Item('note'); newItem.libraryID = this._libraryID; - newItem.setNote(item.note); + if(item.note) newItem.setNote(item.note); var myID = newItem.save(); newItem = Zotero.Items.get(myID); } else { @@ -462,6 +462,7 @@ Zotero.Translate.ItemSaver.prototype = { "_saveNotes":function(item, parentID) { for(var i=0; i<item.notes.length; i++) { var note = item.notes[i]; + if(!note) continue; var myNote = new Zotero.Item('note'); myNote.libraryID = this._libraryID; myNote.setNote(typeof note == "object" ? note.note : note);