Skip to content

Commit

Permalink
Merge pull request #4132 from hashicorp/b-aws-spot-panic
Browse files Browse the repository at this point in the history
provider/aws: Check for nil on some spot instance attributes
  • Loading branch information
catsby committed Dec 1, 2015
2 parents 20beafd + c5f0c8c commit 4e5c5c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions builtin/providers/aws/resource_aws_spot_instance_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e5c5c3

Please sign in to comment.