Skip to content

Commit

Permalink
Fix CP Listing breaking when there's a missing user (#2410)
Browse files Browse the repository at this point in the history
Co-authored-by: Duncan McClean <duncan@mcclean.co.uk>
  • Loading branch information
jasonvarga and duncanmcclean committed Sep 15, 2020
1 parent 278ad21 commit db9968c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Fieldtypes/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,17 @@ public function preProcessIndex($data)
}

return $users->map(function ($user) {
if (! $user) {
return null;
}

return [
'id' => $user->id(),
'title' => $user->get('name', $user->email()),
'edit_url' => $user->editUrl(),
'published' => null,
];
});
})->filter()->values();
}

protected function augmentValue($value)
Expand Down

0 comments on commit db9968c

Please sign in to comment.