fix(actions): Handle missing poll object (#10266)

fix(actions): handle missing poll object

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2024-05-11 09:45:59 +01:00
committed by GitHub
parent 5498e18bf4
commit 7816ec2e6b
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ class MessagePollVoteAddAction extends Action {
const { poll } = message;
const answer = poll.answers.get(data.answer_id);
const answer = poll?.answers.get(data.answer_id);
if (!answer) return false;
answer.voteCount++;

View File

@@ -13,7 +13,7 @@ class MessagePollVoteRemoveAction extends Action {
const { poll } = message;
const answer = poll.answers.get(data.answer_id);
const answer = poll?.answers.get(data.answer_id);
if (!answer) return false;
answer.voteCount--;