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

Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
This commit is contained in:
Kevin Kuehler 2019-11-01 19:36:01 -07:00 committed by Drew DeVault
parent 331b915139
commit ad68a9e4e4

View file

@ -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)