diff --git a/source/Ox/js/Encoding.js b/source/Ox/js/Encoding.js index 27e702a3..940b228f 100644 --- a/source/Ox/js/Encoding.js +++ b/source/Ox/js/Encoding.js @@ -243,7 +243,8 @@ Ox.encodeHTML HTML-encodes a string 'äbçdê' @*/ Ox.encodeHTML = function(string) { - return Ox.map(string.toString(), function(char) { + string = Ox.isUndefined(string) ? '' : string.toString(); + return Ox.map(string, function(char) { var code = char.charCodeAt(0); return code < 128 ? (char in Ox.HTML_ENTITIES ? Ox.HTML_ENTITIES[char] : char)