fix no-longer existing poll options making voting impossible

master
Aevann 2023-11-15 09:51:19 +02:00
parent e7ecde3415
commit 3976b181ac
1 changed files with 4 additions and 2 deletions

View File

@ -35,8 +35,10 @@ function option_vote_1(oid, parentid, kind) {
if (curr && curr.value)
{
const scoretext = document.getElementById('score-' + curr.value);
const score = Number(scoretext.textContent);
scoretext.textContent = score - 1;
if (scoretext) {
const score = Number(scoretext.textContent);
scoretext.textContent = score - 1;
}
}
const scoretext = document.getElementById('score-' + full_oid);