Skip to content

Commit

Permalink
Fix user list errors when deleting roles
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioribeiro committed Nov 20, 2023
1 parent e05f4f4 commit 8691523
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;

Check warning on line 30 in src/Repositories/Behaviors/HandleUserPermissions.php

View check run for this annotation

Codecov / codecov/patch

src/Repositories/Behaviors/HandleUserPermissions.php#L29-L30

Added lines #L29 - L30 were not covered by tests
}

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

0 comments on commit 8691523

Please sign in to comment.