Skip to content

Commit

Permalink
Tracking: safer array access
Browse files Browse the repository at this point in the history
  • Loading branch information
schmitz-ilias committed Nov 7, 2024
1 parent b5419ea commit 968dd2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public function getItems(
* (nor should it), so it needs to be added here.
*/
if (in_array('org_units', $a_user_fields)) {
foreach ($data['set'] as $key => $usr_data) {
foreach (($data['set'] ?? []) as $key => $usr_data) {
if (!isset($usr_data['usr_id'])) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function getItems(): void
* (nor should it), so it needs to be added here.
*/
if (in_array('org_units', $additional_fields)) {
foreach ($tr_data['set'] as $key => $data) {
foreach (($tr_data['set'] ?? []) as $key => $data) {
if (!isset($data['usr_id'])) {
continue;
}
Expand Down

0 comments on commit 968dd2a

Please sign in to comment.