Skip to content

Commit

Permalink
undefine check after concat the hosts (#643)
Browse files Browse the repository at this point in the history
Signed-off-by: Meina Zhou <[email protected]>
  • Loading branch information
zhoumeina authored Jan 2, 2019
1 parent 22bc603 commit 97bb683
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,12 @@ export class CreateVchWizardService {
if (resourceObjIsCluster) {
// if the selected resource is a Cluster we need to validate if any of it hosts is connected to the vds.
const clusterChildsHosts = clusterChilds.map(host => host['value']);
if (item.some(host => clusterChildsHosts.indexOf(host['value']) !== -1)) {
if (item && item.some(host => clusterChildsHosts.indexOf(host['value']) !== -1)) {
results = results.concat(networks[index]);
}
} else {
// if the selected resource is a not Cluster we validate if the selected host is connected to the vds.
if (item.some(host => host['value'] === getMorIdFromObjRef(resourceObj.objRef))) {
if (item && item.some(host => host['value'] === getMorIdFromObjRef(resourceObj.objRef))) {
results = results.concat(networks[index]);
}
}
Expand Down

0 comments on commit 97bb683

Please sign in to comment.