Skip to content

Commit

Permalink
Filter out redacted poll votes to avoid crashing the Poll widget (#28498
Browse files Browse the repository at this point in the history
)

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Nov 20, 2024
1 parent 72989ea commit d8844c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/views/messages/MPollBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote {

export function allVotes(voteRelations: Relations): Array<UserVote> {
if (voteRelations) {
return voteRelations.getRelations().map(userResponseFromPollResponseEvent);
return voteRelations
.getRelations()
.filter((e) => !e.isRedacted())
.map(userResponseFromPollResponseEvent);
} else {
return [];
}
Expand Down

0 comments on commit d8844c6

Please sign in to comment.