Skip to content

Commit

Permalink
Fix deleted users causes error 500
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel authored and ifox committed Oct 14, 2024
1 parent 58dc470 commit 12ff193
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Http/Controllers/Admin/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ private function getLoggedInUserActivities(): LengthAwarePaginator

private function formatActivity(Activity $activity): ?array
{
if (is_null($activity->subject)) {
return null;
}

if ($activity->subject_type === config('twill.auth_activity_causer', 'users')) {
return $this->formatAuthActivity($activity);
}
Expand All @@ -243,10 +247,6 @@ private function formatActivity(Activity $activity): ?array
return null;
}

if (is_null($activity->subject)) {
return null;
}

if (auth('twill_users')->user()->cannot('view-item', $activity->subject)) {
return null;
}
Expand Down

0 comments on commit 12ff193

Please sign in to comment.