From af48353242ffdd8ed04d7e3f83336842bd9c0ff5 Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Sat, 16 Dec 2023 20:12:27 +0800 Subject: [PATCH] Fix role title --- src/Module/Admin/User/Form/EditForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Admin/User/Form/EditForm.php b/src/Module/Admin/User/Form/EditForm.php index 58933f9f..5632d55f 100644 --- a/src/Module/Admin/User/Form/EditForm.php +++ b/src/Module/Admin/User/Form/EditForm.php @@ -118,7 +118,7 @@ function (Form $form) { function (ListField $field, mixed $text, mixed $value) use ($iAmSuperUser) { if ($text instanceof EnumTranslatableInterface || is_numeric($value)) { $value = value($text); - $text = $this->accessService->wrapUserRole($value)->getTitle(); + $text = $this->accessService->wrapUserRole($value)?->getTitle() ?? $value; } if (!$iAmSuperUser && $this->accessService->isSuperUserRole($value)) {