Fixes #1157, Adding an existing tag to an item with no tags breaks Zotero

This commit is contained in:
Dan Stillman 2008-09-01 17:59:25 +00:00
parent f0c4eec238
commit d5bf5c9120

View File

@ -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);