diff options
author | Daniel Bridges <bridges2@gmail.com> | 2019-07-09 17:04:21 -0700 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-07-10 13:21:38 -0400 |
commit | 217e85a55d0c1047bef1e2bc41783ccd4629bfc1 (patch) | |
tree | 5e06a60ccc27e59e4eef63315cea5065b5c3e8c6 /commands/msg/unsubscribe.go | |
parent | 3f30c27bb31f26ca639b7a87d54a7c522bbe8be0 (diff) | |
download | aerc-217e85a55d0c1047bef1e2bc41783ccd4629bfc1.tar.gz |
Fix crashes when operating on empty folder (#216)
Diffstat (limited to 'commands/msg/unsubscribe.go')
-rw-r--r-- | commands/msg/unsubscribe.go | 6 |
1 files changed, 5 insertions, 1 deletions
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") } |