Prevent error when discussion doesn't have any posts

This commit is contained in:
Toby Zerner 2015-05-03 12:09:05 +09:30
parent eabd482921
commit 2b8f7d41f4

View File

@ -60,7 +60,7 @@ export default class DiscussionPage extends Component {
this.discussion(discussion);
var includedPosts = [];
discussion.payload.included.forEach(record => {
discussion.payload.included && discussion.payload.included.forEach(record => {
if (record.type === 'posts') {
includedPosts.push(record.id);
}