mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +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 { poll } = message;
|
||||||
|
|
||||||
const answer = poll.answers.get(data.answer_id);
|
const answer = poll?.answers.get(data.answer_id);
|
||||||
if (!answer) return false;
|
if (!answer) return false;
|
||||||
|
|
||||||
answer.voteCount++;
|
answer.voteCount++;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class MessagePollVoteRemoveAction extends Action {
|
|||||||
|
|
||||||
const { poll } = message;
|
const { poll } = message;
|
||||||
|
|
||||||
const answer = poll.answers.get(data.answer_id);
|
const answer = poll?.answers.get(data.answer_id);
|
||||||
if (!answer) return false;
|
if (!answer) return false;
|
||||||
|
|
||||||
answer.voteCount--;
|
answer.voteCount--;
|
||||||
|
|||||||
Reference in New Issue
Block a user