Skip to content

Commit

Permalink
Fix issue#34555 [BUG] Missing Null check in for loop (#35078)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-hongli1 authored May 23, 2023
1 parent bba0a93 commit d34fecd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ public AvailabilitySetSkuTypes sku() {

@Override
public Set<String> virtualMachineIds() {
if (idOfVMsInSet == null) {
if (idOfVMsInSet == null && this.innerModel().virtualMachines() != null) {
idOfVMsInSet = new HashSet<>();
for (SubResource resource : this.innerModel().virtualMachines()) {
idOfVMsInSet.add(resource.id());
if (resource != null) {
idOfVMsInSet.add(resource.id());
}
}
}
return Collections.unmodifiableSet(idOfVMsInSet);
Expand Down

0 comments on commit d34fecd

Please sign in to comment.