Skip to content

Commit

Permalink
Merge pull request #1345 from yaacov/check-for-array-before-assuming-…
Browse files Browse the repository at this point in the history
…it-can-reduce

Don't assume the resources are array
  • Loading branch information
yaacov authored Oct 7, 2024
2 parents f9a7ec3 + 78983db commit 74ea537
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 74ea537

Please sign in to comment.