From 70f0701de5c1ec67b30ac982ee983eb9ec194018 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 17 Aug 2020 10:59:43 +0100 Subject: [PATCH] null guard group inviter for corrupted groups --- src/components/structures/GroupView.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index a946d16319..2e2fa25169 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -1003,9 +1003,10 @@ export default createReactClass({ this.state.inviterProfile.avatarUrl, 36, 36, ) : null; - let inviterName = group.inviter.userId; + const inviter = group.inviter || {}; + let inviterName = inviter.userId; if (this.state.inviterProfile) { - inviterName = this.state.inviterProfile.displayName || group.inviter.userId; + inviterName = this.state.inviterProfile.displayName || inviter.userId; } return
@@ -1016,7 +1017,7 @@ export default createReactClass({ height={36} /> { _t("%(inviter)s has invited you to join this community", { - inviter: inviterName, + inviter: inviterName || _t("Someone"), }) }