aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/account/view-message.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/account/view-message.go b/commands/account/view-message.go
index edafd09..ea6addc 100644
--- a/commands/account/view-message.go
+++ b/commands/account/view-message.go
@@ -17,8 +17,14 @@ func ViewMessage(aerc *widgets.Aerc, args []string) error {
return errors.New("Usage: view-message")
}
acct := aerc.SelectedAccount()
+ if acct.Messages().Empty() {
+ return nil
+ }
store := acct.Messages().Store()
msg := acct.Messages().Selected()
+ if msg == nil {
+ return nil
+ }
viewer := widgets.NewMessageViewer(aerc.Config(), store, msg)
aerc.NewTab(viewer, runewidth.Truncate(
msg.Envelope.Subject, 32, "…"))