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'); throw new Exception('Invalid type');
} }
execute($find); execute($find);
$id = result_single($find)['id']; $result = result_single($find);
if($id === null) { if(!$result) {
throw new Exception("Invalid username '$clue'"); throw new Exception("Invalid username '$clue'");
} }
$this->id = $id; $this->id = $result['id'];
$this->update_fields(); $this->update_fields();
} }