Improve user class
This commit is contained in:
parent
b65ea3a8be
commit
a08ee70cdb
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,9 @@ class User
|
|||
public function __construct(int $id = -1)
|
||||
{
|
||||
if (-1 === $id) {
|
||||
$this->id = $_SESSION['user']['id'];
|
||||
if (isset($_SESSION['user']['id'])) {
|
||||
$this->id = $_SESSION['user']['id'];
|
||||
}
|
||||
} else {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue