summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view/post/index.js')
-rw-r--r--webapp/components/post_view/post/index.js7
1 files changed, 4 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,