Skip to content

Commit

Permalink
Update WhatsAppImage.php (#512)
Browse files Browse the repository at this point in the history
Avoiding Error Typed property Vonage\Messages\Channel\WhatsApp\WhatsAppImage::$context must not be accessed before initialization
  • Loading branch information
Pier-d authored Oct 14, 2024
1 parent 8d8183a commit 7303140
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Messages/Channel/WhatsApp/WhatsAppImage.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['image'] = $this->image->toArray();

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

return $returnArray;
}
Expand Down

0 comments on commit 7303140

Please sign in to comment.