From 8e97b4742597b668c5e1268c0da04e3c8d163a3f Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 16 Nov 2018 11:11:18 -0300 Subject: [PATCH] Fix crash when deleting a post (#2345) --- app/screens/channel/index.js | 3 --- app/screens/post_options/index.js | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/screens/channel/index.js b/app/screens/channel/index.js index 2b2fbe620..40b00d318 100644 --- a/app/screens/channel/index.js +++ b/app/screens/channel/index.js @@ -5,7 +5,6 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {startPeriodicStatusUpdates, stopPeriodicStatusUpdates, logout} from 'mattermost-redux/actions/users'; -import {init as initWebSocket, close as closeWebSocket} from 'mattermost-redux/actions/websocket'; import {RequestStatus} from 'mattermost-redux/constants'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; @@ -46,8 +45,6 @@ function mapDispatchToProps(dispatch) { logout, selectDefaultTeam, selectInitialChannel, - initWebSocket, - closeWebSocket, recordLoadTime, startPeriodicStatusUpdates, stopPeriodicStatusUpdates, diff --git a/app/screens/post_options/index.js b/app/screens/post_options/index.js index 3771540cf..ac7774d36 100644 --- a/app/screens/post_options/index.js +++ b/app/screens/post_options/index.js @@ -21,8 +21,8 @@ import {getDimensions} from 'app/selectors/device'; import PostOptions from './post_options'; function mapStateToProps(state, ownProps) { - const post = getPost(state, ownProps.postId); - const channel = getChannel(state, post.channel_id); + const post = getPost(state, ownProps.postId) || {}; + const channel = getChannel(state, post.channel_id) || {}; const config = getConfig(state); const license = getLicense(state); const currentUserId = getCurrentUserId(state);