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>
This commit is contained in:
parent
ee964ad6b0
commit
bd8a4feecc
2 changed files with 18 additions and 10 deletions
commands/account
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue