diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index cf4468c1b..7f3200c6e 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -156,8 +156,16 @@ Zotero.Utilities.prototype.cleanTags = function(x) { * => … */ Zotero.Utilities.prototype.htmlSpecialChars = function(str) { - if (typeof str != 'string') { - throw "Argument '" + str + "' must be a string in Zotero.Utilities.htmlSpecialChars()"; + switch (typeof str) { + case 'string': + break; + + case 'number': + str = str + ''; + break; + + default: + throw "Argument '" + str + "' must be a string in Zotero.Utilities.htmlSpecialChars()"; } if (!str) {