Skip to content

Commit

Permalink
Fix user list errors when deleting roles (#2372)
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Renard <[email protected]>
  • Loading branch information
antonioribeiro and ifox authored Jan 9, 2024
1 parent b85f952 commit 3a01156
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Repositories/Behaviors/HandleUserPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function getFormFieldsHandleUserPermissions($object, $fields)

foreach ($object->permissions()->moduleItem()->get() as $permission) {
$model = $permission->permissionable()->first();

if ($model === null) {
continue;
}

$moduleName = getModuleNameByModel($model);
$fields[$moduleName . '_' . $model->id . '_permission'] = $permission->name;
}
Expand Down

0 comments on commit 3a01156

Please sign in to comment.