Skip to content

Commit

Permalink
Merge pull request #15414 from uberbrady/fix_create_user
Browse files Browse the repository at this point in the history
Use the null-safe property accessor for new-user creation
  • Loading branch information
snipe authored Aug 29, 2024
2 parents b64ed25 + da1e383 commit e4ebabd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Requests/SaveUserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function rules()
'company_id' => [
// determines if the user is being moved between companies and checks to see if they have any items assigned
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'));
}
}
Expand Down

0 comments on commit e4ebabd

Please sign in to comment.