From 3976b181acfe3a8008b819da741267251b06eb4b Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 15 Nov 2023 09:51:19 +0200 Subject: [PATCH] fix no-longer existing poll options making voting impossible --- files/assets/js/comments+post_listing.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/assets/js/comments+post_listing.js b/files/assets/js/comments+post_listing.js index 0eb26255f..233ff1548 100644 --- a/files/assets/js/comments+post_listing.js +++ b/files/assets/js/comments+post_listing.js @@ -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);