diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-02-03 09:21:36 -0800 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-02-04 02:53:53 -0800 |
commit | 27ba4ec88776b1f30f31f01e313bdef2096d0705 (patch) | |
tree | a655f74dd5acaccec44680f977927c4451058600 | |
parent | 0a454a46848521e113aad74e294f5d93fee54368 (diff) | |
download | patchfoo-27ba4ec88776b1f30f31f01e313bdef2096d0705.tar.gz patchfoo-27ba4ec88776b1f30f31f01e313bdef2096d0705.zip |
more robust truncate
-rw-r--r-- | lib/render-msg.js | 1 |
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 } |