Fix error copying attachment without path to another library

This commit is contained in:
Dan Stillman 2019-06-11 06:46:09 -04:00
parent 2dce15c35c
commit ccc4dccffd

View file

@ -2905,7 +2905,7 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentPath', {
}
else if (linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL ||
linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE) {
if (!val.startsWith('storage:')) {
if (val && !val.startsWith('storage:')) {
let storagePath = Zotero.Attachments.getStorageDirectory(this).path;
if (!val.startsWith(storagePath)) {
throw new Error("Imported file path must be within storage directory");