mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
avoid to divide by zero
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
c97d02fdde
commit
34686dd581
@ -63,7 +63,10 @@ class PollResultsViewModel @Inject constructor() : ViewModel() {
|
||||
private fun initPollResults(poll: Poll) {
|
||||
_items.value = ArrayList()
|
||||
|
||||
val oneVoteInPercent = HUNDRED / poll.numVoters
|
||||
var oneVoteInPercent = 0
|
||||
if (poll.numVoters != 0) {
|
||||
oneVoteInPercent = HUNDRED / poll.numVoters
|
||||
}
|
||||
|
||||
poll.options?.forEachIndexed { index, option ->
|
||||
val votersAmountForThisOption = getVotersAmountForOption(poll, index)
|
||||
|
Loading…
Reference in New Issue
Block a user