Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tencentcloud/resource_tc_cdn_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ func resourceTencentCloudCdnDomainCreate(d *schema.ResourceData, meta interface{
}
if v, ok := config["force_redirect"]; ok {
forceRedirect := v.([]interface{})
if len(forceRedirect) > 0 {
if len(forceRedirect) > 0 && forceRedirect[0] != nil {
var redirect cdn.ForceRedirect
redirectMap := forceRedirect[0].(map[string]interface{})
if sw := redirectMap["switch"]; sw.(string) != "" {
Expand Down Expand Up @@ -1257,23 +1257,23 @@ func resourceTencentCloudCdnDomainRead(d *schema.ResourceData, meta interface{})
oldHttpsConfigs = d.Get("https_config").([]interface{})
}
oldHttpsConfig := make(map[string]interface{})
if len(oldHttpsConfigs) > 0 {
if len(oldHttpsConfigs) > 0 && oldHttpsConfigs[0] != nil {
oldHttpsConfig = oldHttpsConfigs[0].(map[string]interface{})
}
oldServerConfigs := make([]interface{}, 0)
if _, ok := oldHttpsConfig["server_certificate_config"]; ok {
oldServerConfigs = oldHttpsConfig["server_certificate_config"].([]interface{})
}
oldServerConfig := make(map[string]interface{})
if len(oldServerConfigs) > 0 {
if len(oldServerConfigs) > 0 && oldServerConfigs[0] != nil {
oldServerConfig = oldServerConfigs[0].(map[string]interface{})
}
oldClientConfigs := make([]interface{}, 0)
if _, ok := oldHttpsConfig["client_certificate_config"]; ok {
oldClientConfigs = oldHttpsConfig["client_certificate_config"].([]interface{})
}
oldClientConfig := make(map[string]interface{})
if len(oldClientConfigs) > 0 {
if len(oldClientConfigs) > 0 && oldClientConfigs[0] != nil {
oldClientConfig = oldClientConfigs[0].(map[string]interface{})
}

Expand Down Expand Up @@ -1581,7 +1581,7 @@ func resourceTencentCloudCdnDomainUpdate(d *schema.ResourceData, meta interface{
}
if v, ok := config["force_redirect"]; ok {
forceRedirect := v.([]interface{})
if len(forceRedirect) > 0 {
if len(forceRedirect) > 0 && forceRedirect[0] != nil {
var redirect cdn.ForceRedirect
redirectMap := forceRedirect[0].(map[string]interface{})
if sw := redirectMap["switch"]; sw.(string) != "" {
Expand Down