diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-03-13 11:21:59 -0400 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-03-13 22:11:09 -0400 |
commit | 13b4d448ee2ee7f22bd19edc036d7504f85b742e (patch) | |
tree | 21815741911182660f69d6673c4876f71939a04e | |
parent | c97aacfa635f083c3d435d1834036fca2f6225f9 (diff) | |
download | patchfoo-13b4d448ee2ee7f22bd19edc036d7504f85b742e.tar.gz patchfoo-13b4d448ee2ee7f22bd19edc036d7504f85b742e.zip |
fix rendering some message titles
-rw-r--r-- | lib/render-msg.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index fb4b211..09eb3e2 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -276,7 +276,9 @@ function title(str) { RenderMsg.prototype.title = function (cb) { var self = this - if (typeof self.c.text === 'string') { + if (!self.c || typeof self.c !== 'object') { + cb(null, self.msg.key) + } else if (typeof self.c.text === 'string') { if (self.c.type === 'post') cb(null, title(self.c.text)) else |