From 7ba9fa2e659a2bac63a1422e8e040f89224a6ce9 Mon Sep 17 00:00:00 2001 From: yaacov Date: Mon, 7 Oct 2024 10:58:45 +0300 Subject: [PATCH] Don't assume the resources are array Signed-off-by: yaacov --- .../tabs/VirtualMachines/utils/hooks/useVSphereInventoryVms.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/VirtualMachines/utils/hooks/useVSphereInventoryVms.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/VirtualMachines/utils/hooks/useVSphereInventoryVms.tsx index b1acfa0e9..627adac80 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/VirtualMachines/utils/hooks/useVSphereInventoryVms.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/VirtualMachines/utils/hooks/useVSphereInventoryVms.tsx @@ -47,7 +47,7 @@ export const useVSphereInventoryVms = ( * @returns {{ [key: string]: T }} - A dictionary with resource IDs as keys and Resource objects as values. */ function convertArrayToDictionary(resources: T[]): { [key: string]: T } { - if (!resources) { + if (!resources || !Array.isArray(resources)) { return undefined; }