mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Use the null-safe property accessor for new-user creation
This commit is contained in:
parent
b64ed254e0
commit
da1e383295
|
@ -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