Eliminated a warning due to attempting to index into null

This commit is contained in:
Erik Thuning 2024-02-27 13:49:42 +01:00
parent 362ee182cb
commit deb47f94d3

@ -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();
}