From ad14b44335036d8aba4f5f081650c839f82f0bac Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 21 May 2009 15:23:50 +0000 Subject: [PATCH] Additional safeguard in Zotero.Attachments.getStorageDirectory() --- chrome/content/zotero/xpcom/attachments.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 9cafb661b..f7fc04347 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -970,6 +970,9 @@ Zotero.Attachments = new function(){ if (!item) { throw ("Item " + itemID + " not found in Zotero.Attachments.getStorageDirectory()"); } + if (!item.key) { + throw ("No item key in Zotero.Attachments.getStorageDirectory()"); + } var dir = Zotero.getStorageDirectory(); dir.append(item.key); return dir;