From 13b4d448ee2ee7f22bd19edc036d7504f85b742e Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 13 Mar 2017 11:21:59 -0400 Subject: fix rendering some message titles --- lib/render-msg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3