From 217e85a55d0c1047bef1e2bc41783ccd4629bfc1 Mon Sep 17 00:00:00 2001 From: Daniel Bridges Date: Tue, 9 Jul 2019 17:04:21 -0700 Subject: Fix crashes when operating on empty folder (#216) --- commands/msg/delete.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'commands/msg/delete.go') diff --git a/commands/msg/delete.go b/commands/msg/delete.go index 104e1e1f..36b8d8cf 100644 --- a/commands/msg/delete.go +++ b/commands/msg/delete.go @@ -35,10 +35,10 @@ func (_ Delete) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("No account selected") } store := widget.Store() - if len(store.Uids) == 0 { - return errors.New("No message selected") + msg, err := widget.SelectedMessage() + if err != nil { + return err } - msg := widget.SelectedMessage() _, isMsgView := widget.(*widgets.MessageViewer) if isMsgView { aerc.RemoveTab(widget) -- cgit