From 03fa8c2150a1a167a5e666578559f969ea4ff181 Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:14:51 +0800 Subject: [PATCH] fix a potenial crash for `azurerm_mobile_network_packet_core_control_plane` --- .../mobile_network_packet_core_control_plane_resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go b/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go index bef91b002665..962512888861 100644 --- a/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go +++ b/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go @@ -557,6 +557,9 @@ func (r PacketCoreControlPlaneResource) Delete() sdk.ResourceFunc { Refresh: func() (result interface{}, state string, err error) { resp, err := client.Delete(ctx, *id) if err != nil { + if resp.HttpResponse == nil { + return nil, "", fmt.Errorf("HTTP response was nil") + } if resp.HttpResponse.StatusCode == http.StatusConflict { return nil, "409", nil }