From 110f44e778e00eefd79fc90c817d97d54ff9b2a0 Mon Sep 17 00:00:00 2001 From: Nikolaos Stamatopoulos Date: Thu, 8 Aug 2024 12:54:04 +0300 Subject: [PATCH] fix: Do a nil check for repeat option in escalation data source Fixes: #359 --- opsgenie/data_source_opsgenie_escalation.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opsgenie/data_source_opsgenie_escalation.go b/opsgenie/data_source_opsgenie_escalation.go index fb15e0f3..d446d05f 100644 --- a/opsgenie/data_source_opsgenie_escalation.go +++ b/opsgenie/data_source_opsgenie_escalation.go @@ -118,7 +118,9 @@ func dataSourceOpsgenieEscalationRead(d *schema.ResourceData, meta interface{}) d.Set("name", getResponse.Name) d.Set("description", getResponse.Description) d.Set("rules", flattenOpsgenieEscalationRules(getResponse.Rules)) - d.Set("repeat", flattenOpsgenieEscalationRepeat(getResponse.Repeat)) + if getResponse.Repeat != nil { + d.Set("repeat", flattenOpsgenieEscalationRepeat(getResponse.Repeat)) + } if getResponse.OwnerTeam != nil { d.Set("owner_team_id", getResponse.OwnerTeam.Id) }