diff options
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r-- | widgets/msgviewer.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 0c72fa79..29ad0a83 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -48,6 +48,12 @@ type PartSwitcher struct { func NewMessageViewer( acct *AccountView, msg lib.MessageView, ) *MessageViewer { + if msg == nil { + return &MessageViewer{ + acct: acct, + err: fmt.Errorf("(no message selected)"), + } + } hf := HeaderLayoutFilter{ layout: HeaderLayout(config.Viewer.HeaderLayout), keep: func(msg *models.MessageInfo, header string) bool { |