fix: only set actor on events that have it (#3914)

This commit is contained in:
Sami Mazouz 2023-11-10 22:25:10 +01:00 committed by GitHub
parent bbdf3b5aba
commit a9756cb5eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,9 @@ trait DispatchEventsTrait
}
foreach ($entity->releaseEvents() as $event) {
$event->actor = $actor;
if (property_exists($event, 'actor') && ! $event->actor) {
$event->actor = $actor;
}
$this->events->dispatch($event);
}