From c5f0c8ced625f5a55000e10583829693e9e4477b Mon Sep 17 00:00:00 2001 From: clint shryock Date: Tue, 1 Dec 2015 14:58:59 -0600 Subject: [PATCH] provider/aws: Check for nil on some spot instance attributes --- .../providers/aws/resource_aws_spot_instance_request.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_spot_instance_request.go b/builtin/providers/aws/resource_aws_spot_instance_request.go index 1369c972e..400f7c2b7 100644 --- a/builtin/providers/aws/resource_aws_spot_instance_request.go +++ b/builtin/providers/aws/resource_aws_spot_instance_request.go @@ -194,8 +194,13 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("[ERR] Error reading Spot Instance Data: %s", err) } } - d.Set("spot_request_state", *request.State) - d.Set("block_duration_minutes", *request.BlockDurationMinutes) + + if request.State != nil { + d.Set("spot_request_state", *request.State) + } + if request.BlockDurationMinutes != nil { + d.Set("block_duration_minutes", *request.BlockDurationMinutes) + } d.Set("tags", tagsToMap(request.Tags)) return nil