Fix crash when deleting a post (#2345)

This commit is contained in:
Elias Nahum 2018-11-16 11:11:18 -03:00 committed by Sudheer
parent f85344f8a5
commit 8e97b47425
2 changed files with 2 additions and 5 deletions

View file

@ -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,

View file

@ -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);