Improve user class

This commit is contained in:
Jay Trees 2022-01-18 10:51:51 +01:00
parent b65ea3a8be
commit a08ee70cdb

View file

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