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/unsubscribe.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'commands/msg/unsubscribe.go') diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go index d4a7e9a6..720ff43e 100644 --- a/commands/msg/unsubscribe.go +++ b/commands/msg/unsubscribe.go @@ -34,7 +34,11 @@ func (Unsubscribe) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("Usage: unsubscribe") } widget := aerc.SelectedTab().(widgets.ProvidesMessage) - headers := widget.SelectedMessage().RFC822Headers + msg, err := widget.SelectedMessage() + if err != nil { + return err + } + headers := msg.RFC822Headers if !headers.Has("list-unsubscribe") { return errors.New("No List-Unsubscribe header found") } -- cgit