You are right.
By the way, C# version of this sample is correct:
private ManagedObjectReference traverseSnapshotInTree(
VirtualMachineSnapshotTree[] snapTree,
String findName,
Boolean print) {
ManagedObjectReference snapmor = null;
if (snapTree == null) {
return snapmor;
}
for (int i = 0; i < snapTree.Length && snapmor == null; i++) {
VirtualMachineSnapshotTree node = snapTree[i];
if (print) {
Console.WriteLine("Snapshot Name : " + node.name);
}
if (findName != null && node.name.Equals(findName)) {
snapmor = node.snapshot;
} else {
VirtualMachineSnapshotTree[] childTree = node.childSnapshotList;
snapmor = traverseSnapshotInTree(childTree, findName, print);
}
}
return snapmor;
}
Best regards,
Alexey Barabash