Skip to content

Commit 64e967c

Browse files
committed
Check if voice is set before accessing property
1 parent b06ab72 commit 64e967c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Discord/Discord.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ protected function handleVoiceStateUpdate(object $data): void
673673
$voiceStateUpdate = $this->factory->part(VoiceStateUpdate::class, (array) $data->d, true);
674674

675675
$this->logger->debug('voice state update received', ['guild' => $voiceStateUpdate->guild_id, 'data' => $voiceStateUpdate]);
676-
if (isset($this->voice->clients[$voiceStateUpdate->guild_id])) {
676+
if (isset($this->voice, $this->voice->clients[$voiceStateUpdate->guild_id])) {
677677
/** @var VoiceClient */
678678
$client = $this->voice->clients[$voiceStateUpdate->guild_id];
679679
$client->handleVoiceStateUpdate($voiceStateUpdate);

0 commit comments

Comments
 (0)