Skip to content

Commit

Permalink
Update WhatsAppAudio.php (#514)
Browse files Browse the repository at this point in the history
Avoiding Error Typed property Vonage\Messages\Channel\WhatsApp\WhatsAppAudio::$context must not be accessed before initialization
  • Loading branch information
Pier-d authored Oct 14, 2024
1 parent 4cc6ae6 commit 9c2cd96
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Messages/Channel/WhatsApp/WhatsAppAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ public function toArray(): array
{
$returnArray = $this->getBaseMessageUniversalOutputArray();
$returnArray['audio'] = $this->audioObject->toArray();

if (!is_null($this->context)) {
$returnArray['context'] = $this->context;
}
$returnArray['context'] = $this->context ?? null;

return $returnArray;
}
Expand Down

0 comments on commit 9c2cd96

Please sign in to comment.