ui: fix panic in header formatter
Reported-by: noex Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
1aa32bf377
commit
7fe7fe4ea8
|
@ -130,6 +130,10 @@ func NewMessageViewer(acct *AccountView,
|
||||||
}
|
}
|
||||||
|
|
||||||
func fmtHeader(msg *models.MessageInfo, header string, timefmt string) string {
|
func fmtHeader(msg *models.MessageInfo, header string, timefmt string) string {
|
||||||
|
if msg == nil || msg.Envelope == nil {
|
||||||
|
return "error: no envelope for this message"
|
||||||
|
}
|
||||||
|
|
||||||
switch header {
|
switch header {
|
||||||
case "From":
|
case "From":
|
||||||
return format.FormatAddresses(msg.Envelope.From)
|
return format.FormatAddresses(msg.Envelope.From)
|
||||||
|
|
Loading…
Reference in New Issue