Skip to content

Commit

Permalink
Fix issue where null values are present in the event results
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers authored Feb 3, 2024
1 parent ef05e34 commit 9c1798b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,15 @@ public function getNotificationVars()
/*
* Extensibility
*/
$result = Event::fire('winter.user.getNotificationVars', [$this]);
if ($result && is_array($result)) {
$vars = call_user_func_array('array_merge', $result) + $vars;
$results = Event::fire('winter.user.getNotificationVars', [$this]);
if ($results && is_array($results)) {
$tempResults = [];
foreach ($results as $result) {
if ($result && is_array($result)) {
$tempResults = array_merge($tempResults, $result);
}
}
$vars = $tempResults + $vars;
}

return $vars;
Expand Down

0 comments on commit 9c1798b

Please sign in to comment.