aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-10-19 14:28:50 -0500
committerRobin Jarry <robin@jarry.cc>2022-10-19 21:50:26 +0200
commitbd8a4feecc539a50bec005bd2b58af045d9a51bc (patch)
tree347fce8fe7eef986180121e4b9f9444b89e87d17 /commands/account
parentee964ad6b0bd8ee42e903e25b75d9985dc2ff40e (diff)
downloadaerc-bd8a4feecc539a50bec005bd2b58af045d9a51bc.tar.gz
split: prevent opening split when no messages are selected
The [v]split command panics when it is run with no message selected, or when messages aren't loaded. Check for a valid selected message before creating a split, and report an error if one isn't selected. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/account')
-rw-r--r--commands/account/split.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/commands/account/split.go b/commands/account/split.go
index 2b802256..284182dc 100644
--- a/commands/account/split.go
+++ b/commands/account/split.go
@@ -55,9 +55,7 @@ func (Split) Execute(aerc *widgets.Aerc, args []string) error {
n = 0
}
if args[0] == "split" {
- acct.Split(n)
- return nil
+ return acct.Split(n)
}
- acct.Vsplit(n)
- return nil
+ return acct.Vsplit(n)
}