aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account
diff options
context:
space:
mode:
Diffstat (limited to 'commands/account')
-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 edafd09b..ea6addc2 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, "…"))