remove queue only if index is within the range (#9341)

Fixes minio/mc#3155
This commit is contained in:
Bala FA 2020-04-14 18:06:23 +00:00 committed by GitHub
parent 9054ce73b2
commit 525287f4b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,7 +116,7 @@ func (api objectAPIHandlers) GetBucketNotificationHandler(w http.ResponseWriter,
// With newer config disallowing changing / turning off // With newer config disallowing changing / turning off
// notification targets without removing ARN in notification // notification targets without removing ARN in notification
// configuration we won't see this problem anymore. // configuration we won't see this problem anymore.
if reflect.DeepEqual(queue.ARN, arnErr.ARN) { if reflect.DeepEqual(queue.ARN, arnErr.ARN) && i < len(config.QueueList) {
config.QueueList = append(config.QueueList[:i], config.QueueList = append(config.QueueList[:i],
config.QueueList[i+1:]...) config.QueueList[i+1:]...)
} }