Skip to content

Commit 9c1798b

Browse files
authored
Fix issue where null values are present in the event results
1 parent ef05e34 commit 9c1798b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

models/User.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,15 @@ public function getNotificationVars()
519519
/*
520520
* Extensibility
521521
*/
522-
$result = Event::fire('winter.user.getNotificationVars', [$this]);
523-
if ($result && is_array($result)) {
524-
$vars = call_user_func_array('array_merge', $result) + $vars;
522+
$results = Event::fire('winter.user.getNotificationVars', [$this]);
523+
if ($results && is_array($results)) {
524+
$tempResults = [];
525+
foreach ($results as $result) {
526+
if ($result && is_array($result)) {
527+
$tempResults = array_merge($tempResults, $result);
528+
}
529+
}
530+
$vars = $tempResults + $vars;
525531
}
526532

527533
return $vars;

0 commit comments

Comments
 (0)