~sircmpwn/aerc

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Check for terminal before forwarding mouse event

Details
Message ID
<20191115190249.66971-1-greg@gpanders.com>
DKIM signature
missing
Download raw message
Patch: +1 -1
When viewing a message part with no available filter, clicking the UI
would cause a nil pointer dereference because the MouseEvent was passed
to the PartViewer's `term` field, which does not exist in the case of an
absent filter.
---
 widgets/msgviewer.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 7cd5553..4d41923 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -336,7 +336,7 @@ func (ps *PartSwitcher) MouseEvent(localX int, localY int, event tcell.Event) {
 		case tcell.Button1:
 			height := len(ps.parts)
 			y := ps.height - height
-			if localY < y {
+			if localY < y && ps.parts[ps.selected].term != nil {
 				ps.parts[ps.selected].term.MouseEvent(localX, localY, event)
 			}
 			for i, _ := range ps.parts {
-- 
2.24.0
Details
Message ID
<BYIDRF7CJXLT.8QUQESB22A28@homura>
In-Reply-To
<20191115190249.66971-1-greg@gpanders.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git.sr.ht:~sircmpwn/aerc
   8a84830..3338dce  master -> master