fix exception when adding an poll option without votes

This commit is contained in:
René Wagner 2022-10-28 18:51:35 +02:00 committed by GitHub
parent f418687a71
commit b99e7a9e92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3402,7 +3402,7 @@ class Item
$percent = $option['replies'] / $question['voters'] * 100;
$options[$key]['vote'] = DI::l10n()->tt('%2$s (%3$d%%, %1$d vote)', '%2$s (%3$d%%, %1$d votes)', $option['replies'], $option['name'], round($percent, 1));
} else {
$options[$key]['vote'] = DI::l10n()->tt('%2$s (%1$d vote)', '%2$s (%1$d votes)', $option['replies'], $option['name'], );
$options[$key]['vote'] = DI::l10n()->tt('%2$s (%1$d vote)', '%2$s (%1$d votes)', $option['replies'], $option['name'], 0);
}
}