aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-03 09:21:36 -0800
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-04 02:53:53 -0800
commit27ba4ec88776b1f30f31f01e313bdef2096d0705 (patch)
treea655f74dd5acaccec44680f977927c4451058600 /lib
parent0a454a46848521e113aad74e294f5d93fee54368 (diff)
downloadpatchfoo-27ba4ec88776b1f30f31f01e313bdef2096d0705.tar.gz
patchfoo-27ba4ec88776b1f30f31f01e313bdef2096d0705.zip
more robust truncate
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js1
1 files changed, 1 insertions, 0 deletions
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
}