From 1681a8d5393a8d5e3eb8f785b85f477c627e2fd1 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 25 Sep 2021 00:30:18 +0200 Subject: [PATCH] Azure: Fix panic when no computername is set (#9387) Signed-off-by: Julien Pivotto --- discovery/azure/azure.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discovery/azure/azure.go b/discovery/azure/azure.go index 6de0995ef..b0de0abd8 100644 --- a/discovery/azure/azure.go +++ b/discovery/azure/azure.go @@ -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) }