diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx
index 0c2f1638d1..16028f0975 100644
--- a/src/components/structures/SpaceRoomView.tsx
+++ b/src/components/structures/SpaceRoomView.tsx
@@ -430,7 +430,7 @@ const SpaceSetupPublicShare = ({ space, onFinished }) => {
{ _t("It's just you at the moment, it will be even better with others.") }
-
+
diff --git a/src/components/views/spaces/SpacePublicShare.tsx b/src/components/views/spaces/SpacePublicShare.tsx
index b2d3b7ce29..fa81b75525 100644
--- a/src/components/views/spaces/SpacePublicShare.tsx
+++ b/src/components/views/spaces/SpacePublicShare.tsx
@@ -26,7 +26,7 @@ import {showRoomInviteDialog} from "../../../RoomInvite";
interface IProps {
space: Room;
- onFinished(): void;
+ onFinished?(): void;
}
const SpacePublicShare = ({ space, onFinished }: IProps) => {
@@ -54,7 +54,7 @@ const SpacePublicShare = ({ space, onFinished }: IProps) => {
className="mx_SpacePublicShare_inviteButton"
onClick={() => {
showRoomInviteDialog(space.roomId);
- onFinished();
+ if (onFinished) onFinished();
}}
>
{ _t("Invite people") }