From 02576f3d597b3c419df20f2a50aa6e587f1d98bb Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Wed, 18 May 2016 11:15:17 -0400
Subject: PLT-1909 Fixed error rendering pending posts (#3041)

* Fixed error caused by checking if a post is a system message

* Fixed trying to edit system posts when using the up arrow hotkey
---
 webapp/components/post_info.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'webapp/components/post_info.jsx')

diff --git a/webapp/components/post_info.jsx b/webapp/components/post_info.jsx
index ed316745f..e4ac39447 100644
--- a/webapp/components/post_info.jsx
+++ b/webapp/components/post_info.jsx
@@ -33,7 +33,7 @@ export default class PostInfo extends React.Component {
         var post = this.props.post;
         var isOwner = this.props.currentUser.id === post.user_id;
         var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
-        const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
+        const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
 
         if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || Utils.isPostEphemeral(post)) {
             return '';
-- 
cgit v1.2.3-1-g7c22

