Default to an empty channel object (#5094) (#5095)

(cherry picked from commit ac85110ce7)

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2021-01-07 23:18:29 +01:00 committed by GitHub
parent 64989a728c
commit 60b82ea5a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ function makeMapStateToProps() {
const getChannel = makeGetChannel();
return (state, ownProps) => {
const channel = ownProps.channel || getChannel(state, {id: ownProps.channelId});
const channel = ownProps.channel || getChannel(state, {id: ownProps.channelId}) || {};
const member = getMyChannelMember(state, channel.id);
const currentUserId = getCurrentUserId(state);
const channelDraft = getDraftForChannel(state, channel.id);