From 83dc2e0ad7b297b457dbfe8aa207c7d59c475600 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 1 Apr 2013 02:10:39 -0400 Subject: [PATCH] Don't fail when $NUMBER is missing in tag color chooser localized string --- chrome/content/zotero/tagColorChooser.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/tagColorChooser.js b/chrome/content/zotero/tagColorChooser.js index 3ee3f6d3e..d30e2b594 100644 --- a/chrome/content/zotero/tagColorChooser.js +++ b/chrome/content/zotero/tagColorChooser.js @@ -130,9 +130,15 @@ var Zotero_Tag_Color_Chooser = new function() { num.id = 'number-key'; num.setAttribute('value', parseInt(tagPosition.value) + 1); - instructions.appendChild(document.createTextNode(matches[1])); - instructions.appendChild(num); - instructions.appendChild(document.createTextNode(matches[2])); + if (matches) { + instructions.appendChild(document.createTextNode(matches[1])); + instructions.appendChild(num); + instructions.appendChild(document.createTextNode(matches[2])); + } + // If no $NUMBER variable in translated string, fail as gracefully as possible + else { + instructions.appendChild(document.createTextNode(msg)); + } };