diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-02-22 17:05:46 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-02-22 11:06:15 -0500 |
commit | 1455ad97a9ec138fb7bcab4de8e45a8ad92ddd30 (patch) | |
tree | ca71e599eb747f379d4d82791220cd23b85be44d /widgets/msglist.go | |
parent | cb04629f3c2682494f32261c2a99200e2126f7a5 (diff) | |
download | aerc-1455ad97a9ec138fb7bcab4de8e45a8ad92ddd30.tar.gz |
Fix crash on mouse scrolling before messages load
Using mouse scroll before messages load will trigger a panic as `ml.store` has not been assigned yet and is `nil`.
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r-- | widgets/msglist.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go index 9aff0d4..51c133c 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -163,10 +163,14 @@ func (ml *MessageList) MouseEvent(localX int, localY int, event tcell.Event) { ml.aerc.NewTab(viewer, msg.Envelope.Subject) } case tcell.WheelDown: - ml.store.Next() + if ml.store != nil { + ml.store.Next() + } ml.Scroll() case tcell.WheelUp: - ml.store.Prev() + if ml.store != nil { + ml.store.Prev() + } ml.Scroll() } } |