diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 098f09683c..9cafb661bd 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -967,6 +967,9 @@ Zotero.Attachments = new function(){ function getStorageDirectory(itemID) { var item = Zotero.Items.get(itemID); + if (!item) { + throw ("Item " + itemID + " not found in Zotero.Attachments.getStorageDirectory()"); + } var dir = Zotero.getStorageDirectory(); dir.append(item.key); return dir;