provider/aws: Check for nil on some spot instance attributes

This commit is contained in:
clint shryock 2015-12-01 14:58:59 -06:00
parent 3cbe014e31
commit c5f0c8ced6
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