diff --git a/includes/classes/user.php b/includes/classes/user.php index 34d20e1f..fefdc2c6 100644 --- a/includes/classes/user.php +++ b/includes/classes/user.php @@ -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; }