add ternary on variables in asset count"

This commit is contained in:
Godfrey M
2026-03-04 10:25:59 -08:00
parent 30ac3d1a26
commit e25ea465c5
@@ -649,7 +649,7 @@ class UsersController extends Controller
->withTrashed()
->first();
$indirectItemsCount = $user->assets->flatMap->assignedAssets->count() + $user->assets->flatMap->components->count() + $user->assets->flatMap->licenses->count() + $user->assets->flatMap->assignedAccessories->count();
$indirectItemsCount = $user?->assets?->flatMap->assignedAssets->count() + $user?->assets?->flatMap->components->count() + $user?->assets?->flatMap->licenses->count() + $user?->assets?->flatMap->assignedAccessories->count();
if ($user) {
$this->authorize('view', $user);