mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Another attempt at fixing a reference error
This commit is contained in:
parent
86f3ac74be
commit
d149798154
1 changed files with 7 additions and 1 deletions
|
@ -167,8 +167,14 @@ class User{
|
|||
$this->PasswordHash = null;
|
||||
}
|
||||
|
||||
if(!isset($this->_Benefits)){
|
||||
// Set this for validation purposes.
|
||||
// Skip the accessor because it will attempt to use `$this->UserId` which may not be set yet.
|
||||
$this->_Benefits = new Benefits();
|
||||
}
|
||||
|
||||
// Some benefits require this `User` to have a password set.
|
||||
if($this->Benefits?->RequiresPassword && $this->PasswordHash === null){
|
||||
if($this->Benefits->RequiresPassword && $this->PasswordHash === null){
|
||||
$error->Add(new Exceptions\BenefitsRequirePasswordException());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue