From 867e53372c2a4cc0c5a90ca2b83fa0158e274ac1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 20 Nov 2024 13:56:14 +0000 Subject: [PATCH] Filter out redacted poll votes to avoid crashing the Poll widget 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 de9be6cf91d..9e173e5f4a3 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 []; }