diff --git a/src/Security/Member.php b/src/Security/Member.php index 3a0308a7335..6959631b9d7 100644 --- a/src/Security/Member.php +++ b/src/Security/Member.php @@ -521,13 +521,11 @@ public function encryptWithUserSettings($string) // If the algorithm or salt is not available, it means we are operating // on legacy account with unhashed password. Do not hash the string. - if (!$this->PasswordEncryption) { + if (!$this->PasswordEncryption || !$this->Salt) { return $string; } - // We assume we have PasswordEncryption and Salt available here. $e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption); - return $e->encrypt($string, $this->Salt); }