aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaw Vrana <shaw@vranix.com>2021-01-02 12:18:11 -0800
committerReto Brunner <reto@labrat.space>2021-01-03 09:08:27 +0100
commit3c14c2cb3494766d39e22c852a6a8f8b965dea92 (patch)
tree12e0c48fad141243012ff197fdf8f65342fa222f
parent889d89b42e07e3cbe2d27a08823d26708484f730 (diff)
downloadaerc-3c14c2cb3494766d39e22c852a6a8f8b965dea92.tar.gz
Reapply 'Fix nil pointer deref on Envelope'
The commit bf16ccde484ce3b6d2a4b843e7ebc04a9b2a957d appears to have been unintentionally dropped by commit 905cb9dfd3ef197bb4b59039a1be76ce2c8e3099 (Implement style configuration).
-rw-r--r--widgets/msglist.go9
1 files changed, 6 insertions, 3 deletions
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