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

View file

@ -29,6 +29,9 @@ func SelectMessage(aerc *widgets.Aerc, args []string) error {
if acct == nil {
return errors.New("No account selected")
}
if acct.Messages().Empty() {
return nil
}
acct.Messages().Select(n)
return nil
}