From 0951adab3b57d2a38e42a5f48e29e84bf18860c9 Mon Sep 17 00:00:00 2001 From: Alexander Hellbom Date: Mon, 17 Oct 2016 20:42:11 +0200 Subject: [PATCH] Check for errors when setting schedule_layer --- builtin/providers/pagerduty/resource_pagerduty_schedule.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/providers/pagerduty/resource_pagerduty_schedule.go b/builtin/providers/pagerduty/resource_pagerduty_schedule.go index 34db9d6b7..44fe3094f 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_schedule.go +++ b/builtin/providers/pagerduty/resource_pagerduty_schedule.go @@ -145,7 +145,10 @@ func resourcePagerDutyScheduleRead(d *schema.ResourceData, meta interface{}) err d.Set("name", s.Name) d.Set("description", s.Description) - d.Set("schedule_layer", flattenLayers(s.ScheduleLayers)) + + if err := d.Set("schedule_layer", flattenLayers(s.ScheduleLayers)); err != nil { + return err + } return nil }