diff --git a/app/containers/MessageActions.js b/app/containers/MessageActions.js index 36022756..0c294533 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 f8609587..2df7ee06 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 84661f25..a1de3802 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 });