Skip to content

Commit

Permalink
fix: only set actor on events that have it (#3914)
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 authored Nov 10, 2023
1 parent bbdf3b5 commit a9756cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/core/src/Foundation/DispatchEventsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function dispatchEventsFor(mixed $entity, User $actor = null): void
}

foreach ($entity->releaseEvents() as $event) {
$event->actor = $actor;
if (property_exists($event, 'actor') && ! $event->actor) {
$event->actor = $actor;
}

$this->events->dispatch($event);
}
Expand Down

0 comments on commit a9756cb

Please sign in to comment.