diff options
author | fox.cpp <fox.cpp@disroot.org> | 2020-05-18 19:33:06 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-05-18 18:35:05 +0200 |
commit | 62910a94fbc3749a75e547857b56c94c62e70679 (patch) | |
tree | 067e511c98a011f03f87fcd170d48b15167c06eb /plugins | |
parent | 42c5a8198634bad143cb8ef95985295d3116da5d (diff) | |
download | alps-62910a94fbc3749a75e547857b56c94c62e70679.tar.gz alps-62910a94fbc3749a75e547857b56c94c62e70679.zip |
plugins/base: Add missing nil check for getMailboxByType
Fixes panic if there is no usable Sent folder.
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/base/imap.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/base/imap.go b/plugins/base/imap.go index a693228..06e6e20 100755 --- a/plugins/base/imap.go +++ b/plugins/base/imap.go @@ -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) } + if best == nil { + return nil, nil + } return &MailboxInfo{best}, nil } |