commit ad14b44335036d8aba4f5f081650c839f82f0bac
parent b8599d0414046e360a1b87142182d55aa7977b34
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 21 May 2009 15:23:50 +0000
Additional safeguard in Zotero.Attachments.getStorageDirectory()
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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;