From 9243187490d0d6433662f5cc4caa7dd6ff324c7d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:11:08 -0700 Subject: [PATCH] Fix: handle proxmoxbackupserver without datastore (#3979) --- src/widgets/proxmoxbackupserver/component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/proxmoxbackupserver/component.jsx b/src/widgets/proxmoxbackupserver/component.jsx index 2ad115f82..d6320d616 100644 --- a/src/widgets/proxmoxbackupserver/component.jsx +++ b/src/widgets/proxmoxbackupserver/component.jsx @@ -29,7 +29,7 @@ export default function Component({ service }) { ); } - const datastoreUsage = (datastoreData.data[0].used / datastoreData.data[0].total) * 100; + const datastoreUsage = datastoreData.data ? (datastoreData.data[0].used / datastoreData.data[0].total) * 100 : 0; const cpuUsage = hostData.data.cpu * 100; const memoryUsage = (hostData.data.memory.used / hostData.data.memory.total) * 100; const failedTasks = tasksData.total >= 100 ? "99+" : tasksData.total;