Skip to content

Commit 7d58542

Browse files
authored
Merge pull request #45 from ssbc/fix-nav-to-other-private
Fix crash on viewing some elses private message
2 parents 321ff44 + 2fa8e6a commit 7d58542

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

message/async/name.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ exports.create = function (api) {
2424

2525
if (err && err.name === 'NotFoundError') {
2626
return cb(null, fallbackName + '...(missing)')
27-
} else if (value.content.type === 'post' && typeof value.content.text === 'string') {
27+
} else if (value && value.content.type === 'post' && typeof value.content.text === 'string') {
2828
if (value.content.text.trim()) {
2929
return cb(null, titleFromMarkdown(value.content.text, 40) || fallbackName)
3030
}
31-
} else if (typeof value.content.text === 'string') {
31+
} else if (value && typeof value.content.text === 'string') {
3232
return cb(null, value.content.type + ': ' + titleFromMarkdown(value.content.text, 30))
3333
} else {
3434
return getAboutName(id, cb)

0 commit comments

Comments
 (0)