From d8844c682bbbea8620715eebb9833fa0fbd3a4ac Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 20 Nov 2024 19:01:19 +0000 Subject: [PATCH] Filter out redacted poll votes to avoid crashing the Poll widget (#28498) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/messages/MPollBody.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/MPollBody.tsx b/src/components/views/messages/MPollBody.tsx index de9be6cf91..9e173e5f4a 100644 --- a/src/components/views/messages/MPollBody.tsx +++ b/src/components/views/messages/MPollBody.tsx @@ -383,7 +383,10 @@ function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote { export function allVotes(voteRelations: Relations): Array { if (voteRelations) { - return voteRelations.getRelations().map(userResponseFromPollResponseEvent); + return voteRelations + .getRelations() + .filter((e) => !e.isRedacted()) + .map(userResponseFromPollResponseEvent); } else { return []; }