VMware {code} Community
schiguru
Contributor
Contributor

VM Name Error: Cannot call method 'match' of null

Hello,

I am trying to use vm.name.match(regex) with regex being the VM name that I want my call to look for. I first get a list of all VMs and then loop through each one of them and match the name. On one occasion I got the exception "Cannot call method 'match' of null". I have hundreds of VMs and I must have got this for one of them during the loop process. I saw this exception just once and all subsequent calls did not have this problem. I am just wondering if anyone else encountered this. Could this be a one-off vCenter glitch? I want to understand the cause in order to improve error handling.

Thanks,

Sridhar

0 Kudos
0 Replies