mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
More middleware tests
This commit is contained in:
@@ -12,7 +12,7 @@ class DatabaseBelongsToServer
|
||||
/**
|
||||
* @var \Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface
|
||||
*/
|
||||
protected $repository;
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* DatabaseAccess constructor.
|
||||
@@ -40,7 +40,7 @@ class DatabaseBelongsToServer
|
||||
$server = $request->attributes->get('server');
|
||||
|
||||
$database = $this->repository->find($request->input('database'));
|
||||
if ($database->server_id !== $server->id) {
|
||||
if (is_null($database) || $database->server_id !== $server->id) {
|
||||
throw new NotFoundHttpException;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user