mirror of
https://github.com/zotero/zotero.git
synced 2026-09-27 01:21:27 +00:00
Skip unnecessary SQL query if no attachments in Item#getBestAttachments()
This probably shouldn't be SQL at all, but while it is, skip it if not necessary.
This commit is contained in:
parent
2216729721
commit
5c6400e21b
1 changed files with 4 additions and 0 deletions
|
|
@ -3862,6 +3862,10 @@ Zotero.Item.prototype.getBestAttachments = async function () {
|
|||
throw new Error("getBestAttachments() can only be called on regular items");
|
||||
}
|
||||
|
||||
if (!this.numAttachments()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var url = this.getField('url');
|
||||
var urlFieldID = Zotero.ItemFields.getID('url');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue