Merge pull request #4132 from hashicorp/b-aws-spot-panic

provider/aws: Check for nil on some spot instance attributes
This commit is contained in:
Clint 2015-12-01 15:10:24 -06:00
commit 4e5c5c3ba2
1 changed files with 7 additions and 2 deletions

View File

@ -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