about summary refs log tree commit diff stats
path: root/commands/account/select-message.go
diff options
context:
space:
mode:
authorTom Lebreux <tomlebreux@cock.li>2019-04-16 19:48:05 -0400
committerDrew DeVault <sir@cmpwn.com>2019-04-17 20:02:12 -0400
commit6e11a020d4498f77c858af6b2635bc227537830e (patch)
tree2cab85eb2654cc4a4fbaa691e7a0a21a5df77ae8 /commands/account/select-message.go
parent2925bdfd6c55de5e20cec9f689708d97855a1d08 (diff)
downloadaerc-6e11a020d4498f77c858af6b2635bc227537830e.tar.gz
Fix segfault on :select-message for unloaded messages
Signed-off-by: Tom Lebreux <tomlebreux@cock.li>
Diffstat (limited to 'commands/account/select-message.go')
-rw-r--r--commands/account/select-message.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/commands/account/select-message.go b/commands/account/select-message.go
index 54f48f2..c9e4f8a 100644
--- a/commands/account/select-message.go
+++ b/commands/account/select-message.go
@@ -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
 }