Azure: Fix panic when no computername is set (#9387)

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto 2021-09-25 00:30:18 +02:00 committed by GitHub
parent 3e494eac71
commit 1681a8d539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -464,7 +464,9 @@ func mapFromVM(vm compute.VirtualMachine) virtualMachine {
}
}
if vm.VirtualMachineProperties != nil && vm.VirtualMachineProperties.OsProfile != nil {
if vm.VirtualMachineProperties != nil &&
vm.VirtualMachineProperties.OsProfile != nil &&
vm.VirtualMachineProperties.OsProfile.ComputerName != nil {
computerName = *(vm.VirtualMachineProperties.OsProfile.ComputerName)
}