provider/aws: fix potential panic on nil db name [GH-1460]

This commit is contained in:
Mitchell Hashimoto 2015-04-09 11:19:33 -07:00
parent 4289fbbbda
commit 6f82137875
1 changed files with 6 additions and 1 deletions

View File

@ -348,7 +348,12 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).rdsconn
arn, err := buildRDSARN(d, meta)
if err != nil {
log.Printf("[DEBUG] Error building ARN for DB Instance, not setting Tags for DB %s", *v.DBName)
name := "<empty>"
if v.DBName != "" {
name = *v.DBName
}
log.Printf("[DEBUG] Error building ARN for DB Instance, not setting Tags for DB %s", name)
} else {
resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceMessage{
ResourceName: aws.String(arn),