From 62a0439234c76388e6992647b5599d65ff0b0e24 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 2 Feb 2022 14:58:55 +0200 Subject: [PATCH] [#12783] fix index out of range when there are no filters --- protocol/messenger_mailserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/messenger_mailserver.go b/protocol/messenger_mailserver.go index 6bafc2ac6..4f413fcbd 100644 --- a/protocol/messenger_mailserver.go +++ b/protocol/messenger_mailserver.go @@ -288,7 +288,7 @@ func (m *Messenger) syncFilters(filters []*transport.Filter) (*MessengerResponse prioritizedBatches := getPrioritizedBatches() currentBatch := 0 - if filters[0].Priority == 0 { + if len(filters) == 0 || filters[0].Priority == 0 { currentBatch = len(prioritizedBatches) }