Skip to content

Commit 8fdec4f

Browse files
authored
Merge pull request #1350 from yaacov/check-for-array-before-assuming-it-can-reduce-2.7.2
[v2.7.2] Don't assume the resources are array
2 parents d75b3db + 7ba9fa2 commit 8fdec4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/VirtualMachines/utils/hooks/useVSphereInventoryVms.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const useVSphereInventoryVms = (
4747
* @returns {{ [key: string]: T }} - A dictionary with resource IDs as keys and Resource objects as values.
4848
*/
4949
function convertArrayToDictionary<T>(resources: T[]): { [key: string]: T } {
50-
if (!resources) {
50+
if (!resources || !Array.isArray(resources)) {
5151
return undefined;
5252
}
5353

0 commit comments

Comments
 (0)