diff --git a/message/async/name.js b/message/async/name.js index 7f6fec6..6c41486 100644 --- a/message/async/name.js +++ b/message/async/name.js @@ -24,11 +24,11 @@ exports.create = function (api) { if (err && err.name === 'NotFoundError') { return cb(null, fallbackName + '...(missing)') - } else if (value.content.type === 'post' && typeof value.content.text === 'string') { + } else if (value && value.content.type === 'post' && typeof value.content.text === 'string') { if (value.content.text.trim()) { return cb(null, titleFromMarkdown(value.content.text, 40) || fallbackName) } - } else if (typeof value.content.text === 'string') { + } else if (value && typeof value.content.text === 'string') { return cb(null, value.content.type + ': ' + titleFromMarkdown(value.content.text, 30)) } else { return getAboutName(id, cb)