Skip to content

Commit

Permalink
fix(actions): handle missing poll object
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed May 10, 2024
1 parent e673b3c commit 66e63d3
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 66e63d3

Please sign in to comment.