From 27ba4ec88776b1f30f31f01e313bdef2096d0705 Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 3 Feb 2017 09:21:36 -0800 Subject: more robust truncate --- lib/render-msg.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/render-msg.js') diff --git a/lib/render-msg.js b/lib/render-msg.js index 88e6d97..666e5ff 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -242,6 +242,7 @@ RenderMsg.prototype.getMsgName = function (id, cb) { } function truncate(str, len) { + str = String(str) return str.length > len ? str.substr(0, len) + '...' : str } -- cgit v1.2.3