summary refs log tree commit diff stats
path: root/widgets/account.go
diff options
context:
space:
mode:
authorJelle Besseling <jelle@pingiun.com>2019-08-08 12:48:51 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-12 08:58:57 +0900
commit4478c6a4b7e0bc35211d4ab7c681d5d36563c274 (patch)
treea7bd5bb6e1fcec27e7cc1362138bd39080043b88 /widgets/account.go
parent5b523880b4b4cd2abd9457b4b09c384af33be14b (diff)
downloadaerc-4478c6a4b7e0bc35211d4ab7c681d5d36563c274.tar.gz
Ignore scroll command when msgstore is nil
Fixes ~sircmpwn/aerc2#205. Many functions do a nil check on the store,
so this changes Store() so it returns nil when msglist is nil.

It also places the Scroll() behind the nil check in the next-message command.

https://todo.sr.ht/~sircmpwn/aerc2/205
Diffstat (limited to 'widgets/account.go')
-rw-r--r--widgets/account.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 07b5010..688b660 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -164,6 +164,9 @@ func (acct *AccountView) Messages() *MessageList {
 }
 
 func (acct *AccountView) Store() *lib.MessageStore {
+	if acct.msglist == nil {
+		return nil
+	}
 	return acct.msglist.Store()
 }
 
href='#n154'>154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219