From 3c14c2cb3494766d39e22c852a6a8f8b965dea92 Mon Sep 17 00:00:00 2001 From: Shaw Vrana Date: Sat, 2 Jan 2021 12:18:11 -0800 Subject: Reapply 'Fix nil pointer deref on Envelope' The commit bf16ccde484ce3b6d2a4b843e7ebc04a9b2a957d appears to have been unintentionally dropped by commit 905cb9dfd3ef197bb4b59039a1be76ce2c8e3099 (Implement style configuration). --- widgets/msglist.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'widgets') diff --git a/widgets/msglist.go b/widgets/msglist.go index 827282b3..8f5a06e0 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -102,11 +102,14 @@ func (ml *MessageList) Draw(ctx *ui.Context) { continue } - uiConfig := ml.conf.GetUiConfig(map[config.ContextType]string{ + confParams := map[config.ContextType]string{ config.UI_CONTEXT_ACCOUNT: ml.aerc.SelectedAccount().AccountConfig().Name, config.UI_CONTEXT_FOLDER: ml.aerc.SelectedAccount().Directories().Selected(), - config.UI_CONTEXT_SUBJECT: msg.Envelope.Subject, - }) + } + if msg.Envelope != nil { + confParams[config.UI_CONTEXT_SUBJECT] = msg.Envelope.Subject + } + uiConfig := ml.conf.GetUiConfig(confParams) msg_styles := []config.StyleObject{} // unread message -- cgit