diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt index e17d59893..6613c8f14 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt @@ -115,7 +115,10 @@ class PollResultsFragment( val oneVoteInPercent = 100 / votersAmount poll.options?.forEachIndexed { index, option -> - val votersForThisOption = poll.votes?.filter { it.key.toInt() == index }?.size!! + var votersForThisOption = poll.votes.filter { it.key.toInt() == index }[index.toString()] + if (votersForThisOption == null) { + votersForThisOption = 0 + } val optionsPercent = oneVoteInPercent * votersForThisOption val pollResultItem = PollResultItem(option, optionsPercent)