aboutsummaryrefslogtreecommitdiffstats
path: root/commands/next-message.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-17 14:57:05 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-17 14:57:05 -0400
commit9e28a02f6a4345ec7b5fdee68864610186f34e91 (patch)
tree866940888523f3cafa649697d088c4e016014662 /commands/next-message.go
parentbd71787e3fa9caf53f18dab37c4f37a2631b2354 (diff)
downloadaerc-9e28a02f6a4345ec7b5fdee68864610186f34e91.tar.gz
commands: handle case where no account selected
Diffstat (limited to 'commands/next-message.go')
-rw-r--r--commands/next-message.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/commands/next-message.go b/commands/next-message.go
index 8639973c..d1d188c9 100644
--- a/commands/next-message.go
+++ b/commands/next-message.go
@@ -38,6 +38,9 @@ func NextPrevMessage(aerc *widgets.Aerc, args []string) error {
}
}
acct := aerc.SelectedAccount()
+ if acct == nil {
+ return errors.New("No account selected")
+ }
if pct {
n = int(float64(acct.Messages().Height()) * (float64(n) / 100.0))
}