From 61f86bfdbda70a3e8096836a704d1ee6a3fdcf93 Mon Sep 17 00:00:00 2001 From: SQKo <87897282+SQKo@users.noreply.github.com> Date: Sat, 30 Dec 2023 12:59:56 +0700 Subject: [PATCH] fix(message-reaction): Emoji mutator should be nullable --- src/Discord/Parts/WebSockets/MessageReaction.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Discord/Parts/WebSockets/MessageReaction.php b/src/Discord/Parts/WebSockets/MessageReaction.php index a5d5982ba..a54d47f18 100644 --- a/src/Discord/Parts/WebSockets/MessageReaction.php +++ b/src/Discord/Parts/WebSockets/MessageReaction.php @@ -216,10 +216,14 @@ protected function getMemberAttribute(): ?Member /** * Gets the emoji attribute. * - * @return Emoji + * @return Emoji|null */ - protected function getEmojiAttribute(): Emoji + protected function getEmojiAttribute(): ?Emoji { + if (! isset($this->attributes['emoji'])) { + return null; + } + return $this->factory->part(Emoji::class, (array) $this->attributes['emoji'], true); }