The code does assume there will always be at least an empty instancesSet, which I think is fair to do. However, a simple check to make sure that it is there before trying to iterate over it would be more defensive given the difference in nova's response.
The code does assume there will always be at least an empty instancesSet, which I think is fair to do. However, a simple check to make sure that it is there before trying to iterate over it would be more defensive given the difference in nova's response.