Skip to content

Commit

Permalink
Check properties on mailables are initialized before sharing with the…
Browse files Browse the repository at this point in the history
… view (#49813)
  • Loading branch information
j3j5 committed Jan 24, 2024
1 parent 5f29723 commit 4247b59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/Mailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function buildViewData()
}

foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
if ($property->getDeclaringClass()->getName() !== self::class) {
if ($property->isInitialized($this) && $property->getDeclaringClass()->getName() !== self::class) {
$data[$property->getName()] = $property->getValue($this);
}
}
Expand Down

0 comments on commit 4247b59

Please sign in to comment.