mirror of
https://github.com/flarum/framework.git
synced 2025-05-31 12:35:48 +08:00
Fix crash when displaying a discussion with no posts. closes #823
This commit is contained in:
@ -98,7 +98,9 @@ Object.assign(Discussion.prototype, {
|
||||
* @public
|
||||
*/
|
||||
postIds() {
|
||||
return this.data.relationships.posts.data.map(link => link.id);
|
||||
const posts = this.data.relationships.posts;
|
||||
|
||||
return posts ? posts.data.map(link => link.id) : [];
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user