~sircmpwn/aerc

widgets/msgviewer: Don't crash if pager is nil v1 PROPOSED

Thanks!

To git.sr.ht:~sircmpwn/aerc
   331b915..3ba69ed  master -> master
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/8927/mbox | git am -3
Learn more about email & git

[PATCH] widgets/msgviewer: Don't crash if pager is nil Export this patch

Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
---
 widgets/msgviewer.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 05da2a0..7cd5553 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -506,7 +506,7 @@ func (pv *PartViewer) SetSource(reader io.Reader) {
 }

 func (pv *PartViewer) attemptCopy() {
-	if pv.source != nil && pv.pager.Process != nil {
+	if pv.source != nil && pv.pager != nil && pv.pager.Process != nil {
 		header := message.Header{}
 		header.SetText("Content-Transfer-Encoding", pv.part.Encoding)
 		header.SetContentType(pv.part.MIMEType, pv.part.Params)
--
2.23.0
Thanks!

To git.sr.ht:~sircmpwn/aerc
   331b915..3ba69ed  master -> master
View this thread in the archives