split: prevent panic when store is not set
Prevent panic when split is called but the msgstore is either not initialized or has no UIDs. This condition could be triggered by calling :split or :vsplit immediately at startup. Use the same logic as the :view command, which could operate in a similar manner. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
c6463ba481
commit
7585a54832
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,9 @@ func (Split) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
if acct == nil {
|
if acct == nil {
|
||||||
return errors.New("No account selected")
|
return errors.New("No account selected")
|
||||||
}
|
}
|
||||||
|
if acct.Messages().Empty() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
n := 0
|
n := 0
|
||||||
var err error
|
var err error
|
||||||
if len(args) > 1 {
|
if len(args) > 1 {
|
||||||
|
|
Loading…
Reference in a new issue