Skip to content

Commit

Permalink
fix(actions): Handle missing poll object (#10266)
Browse files Browse the repository at this point in the history
fix(actions): handle missing poll object

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
Jiralite and kodiakhq[bot] committed May 11, 2024
1 parent 5498e18 commit 7816ec2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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++;
Expand Down
Expand Up @@ -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--;
Expand Down

0 comments on commit 7816ec2

Please sign in to comment.