diff --git a/app/Http/Livewire/Server/Show.php b/app/Http/Livewire/Server/Show.php index 75053cc1a..025fc82ff 100644 --- a/app/Http/Livewire/Server/Show.php +++ b/app/Http/Livewire/Server/Show.php @@ -13,7 +13,10 @@ class Show extends Component public function mount() { try { - $this->server = Server::ownedByCurrentTeam(['name', 'description', 'ip', 'port', 'user', 'proxy'])->whereUuid(request()->server_uuid)->firstOrFail(); + $this->server = Server::ownedByCurrentTeam(['name', 'description', 'ip', 'port', 'user', 'proxy'])->whereUuid(request()->server_uuid)->first(); + if (is_null($this->server)) { + return redirect()->route('server.all'); + } } catch (\Throwable $e) { return general_error_handler(err: $e, that: $this); }