summary refs log tree commit diff stats
path: root/commands/msg/delete.go
diff options
context:
space:
mode:
authorDaniel Bridges <bridges2@gmail.com>2019-07-09 17:04:21 -0700
committerDrew DeVault <sir@cmpwn.com>2019-07-10 13:21:38 -0400
commit217e85a55d0c1047bef1e2bc41783ccd4629bfc1 (patch)
tree5e06a60ccc27e59e4eef63315cea5065b5c3e8c6 /commands/msg/delete.go
parent3f30c27bb31f26ca639b7a87d54a7c522bbe8be0 (diff)
downloadaerc-217e85a55d0c1047bef1e2bc41783ccd4629bfc1.tar.gz
Fix crashes when operating on empty folder (#216)
Diffstat (limited to 'commands/msg/delete.go')
-rw-r--r--commands/msg/delete.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/msg/delete.go b/commands/msg/delete.go
index 104e1e1..36b8d8c 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)