diff options
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r-- | webapp/components/post_view/post/index.js | 7 | ||||
-rw-r--r-- | webapp/components/post_view/post_list.jsx | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/webapp/components/post_view/post/index.js b/webapp/components/post_view/post/index.js index 1e195f920..2e7125f34 100644 --- a/webapp/components/post_view/post/index.js +++ b/webapp/components/post_view/post/index.js @@ -12,12 +12,13 @@ import {Preferences} from 'utils/constants.jsx'; import Post from './post.jsx'; function mapStateToProps(state, ownProps) { - const detailedPost = ownProps.post; + const detailedPost = ownProps.post || {}; + return { post: getPost(state, detailedPost.id), lastPostCount: ownProps.lastPostCount, - user: getUser(state, ownProps.post.user_id), - status: getStatusForUserId(state, ownProps.post.user_id), + user: getUser(state, detailedPost.user_id), + status: getStatusForUserId(state, detailedPost.user_id), currentUser: getCurrentUser(state), isFirstReply: Boolean(detailedPost.isFirstReply && detailedPost.commentedOnPost), highlight: detailedPost.highlight, diff --git a/webapp/components/post_view/post_list.jsx b/webapp/components/post_view/post_list.jsx index 3ae768b5c..8d790832e 100644 --- a/webapp/components/post_view/post_list.jsx +++ b/webapp/components/post_view/post_list.jsx @@ -370,6 +370,10 @@ export default class PostList extends React.PureComponent { for (let i = posts.length - 1; i >= 0; i--) { const post = posts[i]; + if (post == null) { + continue; + } + const postCtl = ( <Post ref={post.id} |