plugins/base: Add missing nil check for getMailboxByType

Fixes panic if there is no usable Sent folder.
This commit is contained in:
fox.cpp 2020-05-18 19:33:06 +03:00 committed by Simon Ser
parent 42c5a81986
commit 62910a94fb
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -130,6 +130,9 @@ func getMailboxByType(conn *imapclient.Client, mboxType mailboxType) (*MailboxIn
return nil, fmt.Errorf("failed to get mailbox with attribute %q: %v", attr, err) return nil, fmt.Errorf("failed to get mailbox with attribute %q: %v", attr, err)
} }
if best == nil {
return nil, nil
}
return &MailboxInfo{best}, nil return &MailboxInfo{best}, nil
} }