Fix panic when modifying addresses during changing address mode

This commit is contained in:
Michal Horejsek
2021-01-25 09:17:49 +01:00
parent 0a0cc0a62c
commit 3168cbb77d
2 changed files with 4 additions and 0 deletions

View File

@ -79,6 +79,9 @@ func (store *Store) RebuildMailboxes() (err error) {
// It doesn't do anything to addresses that are rightfully there.
// It should only be called from the event loop.
func (store *Store) createOrDeleteAddressesEvent() (err error) {
store.lock.Lock()
defer store.lock.Unlock()
labels, err := store.initCounts()
if err != nil {
return errors.Wrap(err, "failed to initialise label counts")