Skip to content

Commit

Permalink
Don't assume the resources are array
Browse files Browse the repository at this point in the history
Signed-off-by: yaacov <[email protected]>
  • Loading branch information
yaacov committed Oct 8, 2024
1 parent ff2ae42 commit 7ba9fa2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(resources: T[]): { [key: string]: T } {
if (!resources) {
if (!resources || !Array.isArray(resources)) {
return undefined;
}

Expand Down

0 comments on commit 7ba9fa2

Please sign in to comment.