mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
FIX: don't crash if "latest" poster is missing
This commit is contained in:
parent
81e97c3e44
commit
1ff5ed4e08
@ -34,12 +34,12 @@ const Topic = RestModel.extend({
|
||||
|
||||
@computed('posters.@each')
|
||||
lastPoster(posters) {
|
||||
var user;
|
||||
if (posters && posters.length > 0) {
|
||||
const latest = posters.filter(p => p.extras && p.extras.indexOf("latest") >= 0)[0];
|
||||
return latest.user;
|
||||
} else {
|
||||
return this.get("creator");
|
||||
user = latest && latest.user;
|
||||
}
|
||||
return user || this.get("creator");
|
||||
},
|
||||
|
||||
@computed('fancy_title')
|
||||
|
Loading…
Reference in New Issue
Block a user