~sircmpwn/aerc

Fix crash on mouse scrolling before messages load v1 PROPOSED

Wiktor Kwapisiewicz: 1
 Fix crash on mouse scrolling before messages load

 1 files changed, 6 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/9839/mbox | git am -3
Learn more about email & git

[PATCH] Fix crash on mouse scrolling before messages load Export this patch

Using mouse scroll before messages load will trigger a panic as
`ml.store` has not been assigned yet and is `nil`.
---
 widgets/msglist.go | 8 ++++++--
 1 file 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()
		}
	}
-- 
2.25.1
Curious to know – was this in response to https://todo.sr.ht/~sircmpwn/aerc2/348
(Crash on embedded terminal mouse scroll event), or was it unrelated?
Thanks!

To git.sr.ht:~sircmpwn/aerc
   cb04629..1455ad9  master -> master