From 525287f4b6a20f3564248a46ae1d7917e8332688 Mon Sep 17 00:00:00 2001 From: Bala FA Date: Tue, 14 Apr 2020 18:06:23 +0000 Subject: [PATCH] remove queue only if index is within the range (#9341) Fixes minio/mc#3155 --- cmd/bucket-notification-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bucket-notification-handlers.go b/cmd/bucket-notification-handlers.go index 038425385..b15dcac94 100644 --- a/cmd/bucket-notification-handlers.go +++ b/cmd/bucket-notification-handlers.go @@ -116,7 +116,7 @@ func (api objectAPIHandlers) GetBucketNotificationHandler(w http.ResponseWriter, // With newer config disallowing changing / turning off // notification targets without removing ARN in notification // 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[i+1:]...) }