diff --git a/app/containers/MessageActions.js b/app/containers/MessageActions.js index 360227562..0c294533a 100644 --- a/app/containers/MessageActions.js +++ b/app/containers/MessageActions.js @@ -262,6 +262,9 @@ class MessageActions extends React.Component { handleShare = async() => { const { message } = this.props; const permalink = await this.getPermalink(message); + if (!permalink) { + return; + } Share.share({ message: permalink }); diff --git a/app/views/InviteUsersView/index.js b/app/views/InviteUsersView/index.js index f8609587c..2df7ee064 100644 --- a/app/views/InviteUsersView/index.js +++ b/app/views/InviteUsersView/index.js @@ -52,7 +52,7 @@ class InviteUsersView extends React.Component { share = () => { const { invite } = this.props; - if (!invite) { + if (!invite || !invite.url) { return; } Share.share({ message: invite.url }); diff --git a/app/views/RoomActionsView/index.js b/app/views/RoomActionsView/index.js index 84661f25c..a1de38022 100644 --- a/app/views/RoomActionsView/index.js +++ b/app/views/RoomActionsView/index.js @@ -389,6 +389,9 @@ class RoomActionsView extends React.Component { handleShare = () => { const { room } = this.state; const permalink = RocketChat.getPermalinkChannel(room); + if (!permalink) { + return; + } Share.share({ message: permalink });