FIX fix issue where member without valid email can not be saved

It is possible to have a member record without a valid email address. In this case, you can not save Member as it throws an error (email is tried being sent without a valid email address).
This commit is contained in:
Nicolaas / Sunny Side Up 2023-05-12 10:20:56 +12:00 committed by Guy Sartorelli
parent 6cb35972c9
commit 675ba90280
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A

View File

@ -774,7 +774,7 @@ class Member extends DataObject
if ((Director::isLive() || Injector::inst()->get(MailerInterface::class) instanceof TestMailer)
&& $this->isChanged('Password')
&& $this->record['Password']
&& $this->Email
&& Email::is_valid_address($this->Email ?? '')
&& static::config()->get('notify_password_change')
&& $this->isInDB()
) {