Fix segfault on :select-message for unloaded messages

Signed-off-by: Tom Lebreux <tomlebreux@cock.li>
This commit is contained in:
Tom Lebreux 2019-04-16 19:48:05 -04:00 committed by Drew DeVault
parent 2925bdfd6c
commit 6e11a020d4
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ func SelectMessage(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
}
acct.Messages().Select(n) acct.Messages().Select(n)
return nil return nil
} }