From 014a12722ffed93023e925837dd6bfe0ab1f0f55 Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:35:11 +0800 Subject: [PATCH] `azurerm_app_configuration`: fix a potential crash (#23302) * bugfix #23290 Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com> * update per comment Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com> --------- Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com> --- .../services/appconfiguration/app_configuration_resource.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/services/appconfiguration/app_configuration_resource.go b/internal/services/appconfiguration/app_configuration_resource.go index ef9a52ed8462..4c1bd7415e50 100644 --- a/internal/services/appconfiguration/app_configuration_resource.go +++ b/internal/services/appconfiguration/app_configuration_resource.go @@ -647,11 +647,12 @@ type flattenedAccessKeys struct { } func expandAppConfigurationEncryption(input []interface{}) *configurationstores.EncryptionProperties { - if len(input) == 0 { + if len(input) == 0 || input[0] == nil { return nil } encryptionParam := input[0].(map[string]interface{}) + result := &configurationstores.EncryptionProperties{ KeyVaultProperties: &configurationstores.KeyVaultProperties{}, }