commit b8599d0414046e360a1b87142182d55aa7977b34
parent a150c134bc3e3e24e3c1d4103414ef2cb76fb3ef
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 21 May 2009 14:27:36 +0000
Add a safeguard into Zotero.Attachments.getStorageDirectory(itemID) to make sure it returns an actual item directory
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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;