commit d5bf5c912074db8ac6fc29b43dbd35114c1f3ebb
parent f0c4eec238944ab0961cef27fed230b48a70052e
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 1 Sep 2008 17:59:25 +0000
Fixes #1157, Adding an existing tag to an item with no tags breaks Zotero
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -2664,8 +2664,8 @@ Zotero.Item.prototype.addTag = function(name, type) {
Zotero.DB.beginTransaction();
var matchingTags = Zotero.Tags.getIDs(name);
- if (matchingTags) {
- var itemTags = this.getTags();
+ var itemTags = this.getTags();
+ if (matchingTags && itemTags) {
for each(var id in matchingTags) {
if (itemTags.indexOf(id) != -1) {
var tag = Zotero.Tags.get(id);