Fix null pointer exception in Index.php
This commit is contained in:
parent
34aa4c6412
commit
2c41b5d4fb
1 changed files with 5 additions and 2 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
class Index extends Component
|
class Index extends Component
|
||||||
{
|
{
|
||||||
public Service $service;
|
public ?Service $service = null;
|
||||||
public ?ServiceApplication $serviceApplication = null;
|
public ?ServiceApplication $serviceApplication = null;
|
||||||
public ?ServiceDatabase $serviceDatabase = null;
|
public ?ServiceDatabase $serviceDatabase = null;
|
||||||
public array $parameters;
|
public array $parameters;
|
||||||
|
|
@ -26,7 +26,10 @@ public function mount()
|
||||||
$this->services = collect([]);
|
$this->services = collect([]);
|
||||||
$this->parameters = get_route_parameters();
|
$this->parameters = get_route_parameters();
|
||||||
$this->query = request()->query();
|
$this->query = request()->query();
|
||||||
$this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
|
$this->service = Service::whereUuid($this->parameters['service_uuid'])->first();
|
||||||
|
if (!$this->service) {
|
||||||
|
return redirect()->route('dashboard');
|
||||||
|
}
|
||||||
$service = $this->service->applications()->whereUuid($this->parameters['stack_service_uuid'])->first();
|
$service = $this->service->applications()->whereUuid($this->parameters['stack_service_uuid'])->first();
|
||||||
if ($service) {
|
if ($service) {
|
||||||
$this->serviceApplication = $service;
|
$this->serviceApplication = $service;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue