Handle invalid type asignment

This commit is contained in:
Dennis Eichhorn 2018-07-12 20:27:02 +02:00
parent 5639b7936d
commit d494da3d3b

View File

@ -561,11 +561,13 @@ class Account implements ArrayableInterface, \JsonSerializable
*/ */
public function generatePassword(string $password) : void public function generatePassword(string $password) : void
{ {
$this->password = \password_hash($password, \PASSWORD_DEFAULT); $temp = \password_hash($password, \PASSWORD_DEFAULT);
if ($this->password === false) { if ($temp === false) {
throw new \Exception(); throw new \Exception();
} }
$this->password = $temp;
} }
/** /**