diff --git a/include/User.php b/include/User.php index 0792fde..b726956 100644 --- a/include/User.php +++ b/include/User.php @@ -27,11 +27,11 @@ class User extends Entity { throw new Exception('Invalid type'); } execute($find); - $id = result_single($find)['id']; - if($id === null) { + $result = result_single($find); + if(!$result) { throw new Exception("Invalid username '$clue'"); } - $this->id = $id; + $this->id = $result['id']; $this->update_fields(); }