don't throw if callback is not passed to importFromDocument
This commit is contained in:
parent
b3fc63653f
commit
3ab09692a2
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue