mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
Prevent error when discussion doesn't have any posts
This commit is contained in:
parent
eabd482921
commit
2b8f7d41f4
|
@ -60,7 +60,7 @@ export default class DiscussionPage extends Component {
|
||||||
this.discussion(discussion);
|
this.discussion(discussion);
|
||||||
|
|
||||||
var includedPosts = [];
|
var includedPosts = [];
|
||||||
discussion.payload.included.forEach(record => {
|
discussion.payload.included && discussion.payload.included.forEach(record => {
|
||||||
if (record.type === 'posts') {
|
if (record.type === 'posts') {
|
||||||
includedPosts.push(record.id);
|
includedPosts.push(record.id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user