Crash on delete in empty folder (#213)

This commit is contained in:
Zach Sisco 2019-07-02 21:46:05 -04:00 committed by Drew DeVault
parent 030f390436
commit ddd0fa428f
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ func (_ Delete) Execute(aerc *widgets.Aerc, args []string) error {
return errors.New("No account selected") return errors.New("No account selected")
} }
store := widget.Store() store := widget.Store()
if len(store.Uids) == 0 {
return errors.New("No message selected")
}
msg := widget.SelectedMessage() msg := widget.SelectedMessage()
_, isMsgView := widget.(*widgets.MessageViewer) _, isMsgView := widget.(*widgets.MessageViewer)
if isMsgView { if isMsgView {