commit 3ab09692a2720660491d0e719f2280728450a0ec
parent b3fc63653f047431e1383b4f615e59a3fe5c35b0
Author: Simon Kornblith <simon@simonster.com>
Date: Thu, 17 Mar 2011 18:48:53 +0000
don't throw if callback is not passed to importFromDocument
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js
@@ -236,7 +236,7 @@ Zotero.Attachments = new function(){
var importCallback = function (item) {
browser.removeEventListener("pageshow", onpageshow, false);
Zotero.Browser.deleteHiddenBrowser(browser);
- callback(item);
+ if(callback) callback(item);
};
Zotero.Attachments.importFromDocument(browser.contentDocument,
sourceItemID, forceTitle, parentCollectionIDs, importCallback, libraryID);
@@ -358,7 +358,7 @@ Zotero.Attachments = new function(){
nsIURL.spec = url;
wbp.saveURI(nsIURL, null, null, null, null, file);
- callback(attachmentItem);
+ if(callback) callback(attachmentItem);
return attachmentItem;
}