aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js4
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