From b11eb3262b0ce1256bd7cb9543cdfc162697c357 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Mon, 14 Oct 2019 22:08:37 -0400 Subject: [PATCH] fix: comment create without existing channel --- dist/bundle.es.js | 2 +- src/redux/actions/comments.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index e177391..8717d44 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -3854,7 +3854,7 @@ function doCommentCreate(comment = '', claim_id = '', channel, parent_id) { type: COMMENT_CREATE_STARTED }); const myChannels = selectMyChannelClaims(state); - const namedChannelClaim = myChannels.find(myChannel => myChannel.name === channel); + const namedChannelClaim = myChannels && myChannels.find(myChannel => myChannel.name === channel); const channel_id = namedChannelClaim ? namedChannelClaim.claim_id : null; return lbryProxy.comment_create({ comment, diff --git a/src/redux/actions/comments.js b/src/redux/actions/comments.js index 3de70e6..61e9f6b 100644 --- a/src/redux/actions/comments.js +++ b/src/redux/actions/comments.js @@ -48,7 +48,8 @@ export function doCommentCreate( type: ACTIONS.COMMENT_CREATE_STARTED, }); const myChannels = selectMyChannelClaims(state); - const namedChannelClaim = myChannels.find(myChannel => myChannel.name === channel); + const namedChannelClaim = + myChannels && myChannels.find(myChannel => myChannel.name === channel); const channel_id = namedChannelClaim ? namedChannelClaim.claim_id : null; return Lbry.comment_create({ comment,