Skip to content

Commit

Permalink
fix: only set actor on events that have it
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Oct 29, 2023
1 parent d154388 commit d304e17
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 d304e17

Please sign in to comment.