summary refs log tree commit diff stats
path: root/commands/msg/unsubscribe.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msg/unsubscribe.go')
-rw-r--r--commands/msg/unsubscribe.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go
index d4a7e9a..720ff43 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")
 	}