mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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++;
|
||||
|
||||
@@ -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--;
|
||||
|
||||
Reference in New Issue
Block a user