1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 07:27:39 +02:00

Fix crash when displaying a discussion with no posts. closes #823

This commit is contained in:
Toby Zerner
2016-02-22 22:22:49 +10:30
parent 71d2e71908
commit 05fe4446bf
4 changed files with 13 additions and 7 deletions

View File

@@ -22244,9 +22244,11 @@ System.register('flarum/models/Discussion', ['flarum/Model', 'flarum/utils/mixin
* @public
*/
postIds: function postIds() {
return this.data.relationships.posts.data.map(function (link) {
var posts = this.data.relationships.posts;
return posts ? posts.data.map(function (link) {
return link.id;
});
}) : [];
}
});