Skip to content

Commit 16cc087

Browse files
committed
add
1 parent a734973 commit 16cc087

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tencentcloud/services/tat/resource_tc_tat_command.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,17 @@ func resourceTencentCloudTatCommandCreate(d *schema.ResourceData, meta interface
182182

183183
if v, ok := d.GetOk("tags"); ok {
184184
for _, item := range v.([]interface{}) {
185-
dMap := item.(map[string]interface{})
186-
tag := tat.Tag{}
187-
if v, ok := dMap["key"]; ok {
188-
tag.Key = helper.String(v.(string))
185+
if dMap, ok := item.(map[string]interface{}); ok && dMap != nil {
186+
tag := tat.Tag{}
187+
if v, ok := dMap["key"]; ok {
188+
tag.Key = helper.String(v.(string))
189+
}
190+
if v, ok := dMap["value"]; ok {
191+
tag.Value = helper.String(v.(string))
192+
}
193+
194+
request.Tags = append(request.Tags, &tag)
189195
}
190-
if v, ok := dMap["value"]; ok {
191-
tag.Value = helper.String(v.(string))
192-
}
193-
194-
request.Tags = append(request.Tags, &tag)
195196
}
196197
}
197198

0 commit comments

Comments
 (0)