Eliminated a warning due to attempting to index into null
This commit is contained in:
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user