From bf346ceccadac394ce52268ab32dbdfda29201c5 Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Tue, 16 Dec 2025 08:02:16 -0500 Subject: [PATCH] Fix null status handling in overview page - Add try-catch around loadVmStatus calls in Overview.php - Add null checks in checkStatus method - Wrap entire overview content in @if(\) / @else block - Show friendly error state with retry button when status unavailable --- .../Servers/Proxmox/Livewire/Overview.php | 27 ++++++++++++++++--- .../Servers/Proxmox/views/overview.blade.php | 20 ++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/extensions/Servers/Proxmox/Livewire/Overview.php b/extensions/Servers/Proxmox/Livewire/Overview.php index a31faf9ab..8460a938a 100644 --- a/extensions/Servers/Proxmox/Livewire/Overview.php +++ b/extensions/Servers/Proxmox/Livewire/Overview.php @@ -43,7 +43,11 @@ class Overview extends Component parent::mount($server); if (is_null($this->status)) { - $this->loadVmStatus(); + try { + $this->loadVmStatus(); + } catch (\Throwable $e) { + \Log::error('Overview: Failed to load VM status', ['error' => $e->getMessage()]); + } } $this->hostname = $server->hostname ?? ($this->status->name ?? ''); @@ -60,9 +64,24 @@ class Overview extends Component public function checkStatus() { - $currentStatus = $this->status->status; - $this->loadVmStatus(); - if ($this->status->status != $currentStatus) { + if (!$this->status) { + try { + $this->loadVmStatus(); + } catch (\Throwable $e) { + \Log::error('Overview: checkStatus failed', ['error' => $e->getMessage()]); + } + return; + } + + $currentStatus = $this->status->status ?? null; + try { + $this->loadVmStatus(); + } catch (\Throwable $e) { + \Log::error('Overview: checkStatus loadVmStatus failed', ['error' => $e->getMessage()]); + return; + } + + if ($this->status && ($this->status->status ?? null) != $currentStatus) { $this->fastPolling = false; } } diff --git a/extensions/Servers/Proxmox/views/overview.blade.php b/extensions/Servers/Proxmox/views/overview.blade.php index c88f31bff..75f2fda26 100644 --- a/extensions/Servers/Proxmox/views/overview.blade.php +++ b/extensions/Servers/Proxmox/views/overview.blade.php @@ -5,6 +5,25 @@ :status-polling="true" :status-polling-interval="'2s'" > + @if(!$status) + {{-- Error state when status cannot be loaded --}} +
+
+ +

Unable to Load Server Status

+
+

We couldn't retrieve the current status from the hypervisor. This may be due to:

+ + +
+ @else @endonce +@endif \ No newline at end of file