commit d60b0221db46bde6143aee3a13f534287f4b2a72
parent e20bd357566730aa273764f11438835fcfc472bd
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 14 Mar 2013 19:03:20 -0400
Fix error trying to toggle colored tag with no tag
(This should be fixed so that the setting is always removed, though.)
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/data/tags.js b/chrome/content/zotero/xpcom/data/tags.js
@@ -635,7 +635,12 @@ Zotero.Tags = new function() {
this.toggleItemsListTags = function (libraryID, items, name) {
var self = this;
return Q.fcall(function () {
- var tagIDs = self.getIDs(name, libraryID);
+ var tagIDs = self.getIDs(name, libraryID) || [];
+ // If there's a color setting but no matching tag, don't throw
+ // an error (though ideally this wouldn't be possible).
+ if (!tagIDs.length) {
+ return;
+ }
var tags = tagIDs.map(function (tagID) {
return Zotero.Tags.get(tagID, true);
});