Skip to content

Commit 6047714

Browse files
committed
add
1 parent 9216eab commit 6047714

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tencentcloud/services/cos/resource_tc_cos_bucket.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,9 +1963,14 @@ func ACLBodyDiffFunc(olds, news string, d *schema.ResourceData) (result bool) {
19631963
newOwnerId := newOwner.SelectElement("ID")
19641964
newOwnerName := newOwner.SelectElement("DisplayName")
19651965

1966+
if oldOwnerId == nil || newOwnerId == nil {
1967+
log.Println("[CRITAL]oldOwnerId or newOwnerId is nil: return false.")
1968+
return false
1969+
}
1970+
19661971
// diff: Owner element
1967-
if oldOwnerId.Text() != newOwnerId.Text() || oldOwnerName.Text() != newOwnerName.Text() {
1968-
log.Printf("[CRITAL]OwnerId[old:%s, new:%s] or OwnerName[old:%s, new:%s] not equal: return false.\n", oldOwnerId.Text(), newOwnerId.Text(), oldOwnerName.Text(), newOwnerName.Text())
1972+
if oldOwnerId.Text() != newOwnerId.Text() {
1973+
log.Printf("[CRITAL]OwnerId[old:%s, new:%s] not equal: return false.\n", oldOwnerId.Text(), newOwnerId.Text())
19691974
return false
19701975
}
19711976

0 commit comments

Comments
 (0)