fix(poll): filter users array before processing

Fix a crash in the polls live result by filtering out undefined users.
This scenario might happen when getting user information by an id that
is not present in the current usernames list by some inconsistency
between the user's information from the users context and poll
votes/responses.
This commit is contained in:
Arthurk12 2024-04-19 09:42:19 -03:00 committed by prlanzarin
parent 356f6331c1
commit 8dad2db2e2

View File

@ -73,6 +73,7 @@ class LiveResult extends PureComponent {
: [...users]; : [...users];
userAnswers = userAnswers.map(id => usernames[id]) userAnswers = userAnswers.map(id => usernames[id])
.filter((user) => user)
.map((user) => { .map((user) => {
let answer = ''; let answer = '';