mirror of
https://github.com/discourse/discourse.git
synced 2025-04-10 03:00:49 +08:00
FIX: Check if last poster exists before using it
There was a problem when admins viewed topics where the last poster was deleted.
This commit is contained in:
parent
c8856c7a43
commit
6c6c56613d
@ -172,9 +172,11 @@ export default function transformPost(
|
|||||||
postAtts.createdByName = createdBy.name;
|
postAtts.createdByName = createdBy.name;
|
||||||
|
|
||||||
postAtts.lastPostUrl = topic.get("lastPostUrl");
|
postAtts.lastPostUrl = topic.get("lastPostUrl");
|
||||||
postAtts.lastPostUsername = details.last_poster.username;
|
if (details.last_poster) {
|
||||||
postAtts.lastPostAvatarTemplate = details.last_poster.avatar_template;
|
postAtts.lastPostUsername = details.last_poster.username;
|
||||||
postAtts.lastPostName = details.last_poster.name;
|
postAtts.lastPostAvatarTemplate = details.last_poster.avatar_template;
|
||||||
|
postAtts.lastPostName = details.last_poster.name;
|
||||||
|
}
|
||||||
postAtts.lastPostAt = topic.last_posted_at;
|
postAtts.lastPostAt = topic.last_posted_at;
|
||||||
|
|
||||||
postAtts.topicReplyCount = topic.get("replyCount");
|
postAtts.topicReplyCount = topic.get("replyCount");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user