Fix Zotero.Item.fileExists calling on unsaved item (#4468)
This commit is contained in:
parent
a538a5588e
commit
6530ccd101
1 changed files with 5 additions and 0 deletions
|
@ -2794,6 +2794,11 @@ Zotero.Item.prototype.fileExists = Zotero.Promise.coroutine(function* () {
|
|||
if (this.attachmentLinkMode == Zotero.Attachments.LINK_MODE_LINKED_URL) {
|
||||
throw new Error("Zotero.Item.fileExists() cannot be called on link attachments");
|
||||
}
|
||||
|
||||
// Allow unsaved items to be checked, used by conflict-resolution window
|
||||
if (!this.key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!(yield this.getFilePathAsync());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue