From dc1060c08e347be12abe5e272914e8390b15f00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Mon, 7 Aug 2023 09:18:08 +0200 Subject: [PATCH] Fix handling of nil notify_by list (#2046) Backend can reset it to null when editing a dasboard. Closes #2045 --- datadog/resource_datadog_dashboard.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datadog/resource_datadog_dashboard.go b/datadog/resource_datadog_dashboard.go index c65f1a8d7..bda9c02fe 100644 --- a/datadog/resource_datadog_dashboard.go +++ b/datadog/resource_datadog_dashboard.go @@ -677,6 +677,10 @@ func buildDatadogNotifyList(terraformNotifyList *schema.Set) *[]string { } func buildTerraformNotifyList(datadogNotifyList *[]string) *[]string { + if datadogNotifyList == nil { + terraformNotifyList := make([]string, 0) + return &terraformNotifyList + } terraformNotifyList := make([]string, len(*datadogNotifyList)) for i, authorHandle := range *datadogNotifyList { terraformNotifyList[i] = authorHandle