plugins/base: Add missing nil check for getMailboxByType
Fixes panic if there is no usable Sent folder.
This commit is contained in:
parent
42c5a81986
commit
62910a94fb
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue