From d494da3d3bdcc6e5d126246d49fdbeeb2bd13931 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 12 Jul 2018 20:27:02 +0200 Subject: [PATCH] Handle invalid type asignment --- Account/Account.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Account/Account.php b/Account/Account.php index 597ea510c..35fa37898 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -561,11 +561,13 @@ class Account implements ArrayableInterface, \JsonSerializable */ 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(); } + + $this->password = $temp; } /**