mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-13 17:14:10 -08:00
Merge pull request #15414 from uberbrady/fix_create_user
Use the null-safe property accessor for new-user creation
This commit is contained in:
commit
e4ebabdaba
|
@ -37,7 +37,7 @@ class SaveUserRequest extends FormRequest
|
||||||
'company_id' => [
|
'company_id' => [
|
||||||
// determines if the user is being moved between companies and checks to see if they have any items assigned
|
// determines if the user is being moved between companies and checks to see if they have any items assigned
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
if (($this->has('company_id')) && ($this->user->allAssignedCount() > 0) && (Setting::getSettings()->full_multiple_companies_support)) {
|
if (($this->has('company_id')) && ($this->user?->allAssignedCount() > 0) && (Setting::getSettings()->full_multiple_companies_support)) {
|
||||||
$fail(trans('admin/users/message.error.multi_company_items_assigned'));
|
$fail(trans('admin/users/message.error.multi_company_items_assigned'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue