diff --git a/phpmyfaq/src/phpMyFAQ/Session.php b/phpmyfaq/src/phpMyFAQ/Session.php index 074f4750e9..39d95aa9a2 100644 --- a/phpmyfaq/src/phpMyFAQ/Session.php +++ b/phpmyfaq/src/phpMyFAQ/Session.php @@ -342,7 +342,7 @@ public function userTracking(string $action, int|string|null $data = null): void "INSERT INTO %sfaqsessions (sid, user_id, ip, time) VALUES (%d, %d, '%s', %d)", Database::getTablePrefix(), $this->getCurrentSessionId(), - $this->currentUser->getUserId(), + isset($this->currentUser) ? $this->currentUser->getUserId() : 0, $remoteAddress, $request->server->get('REQUEST_TIME') );