Skip to content

Commit

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

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

return $returnArray;
}
Expand Down

0 comments on commit 4cc6ae6

Please sign in to comment.