1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2025-08-21 18:02:57 +02:00
aerc/app
Robin Jarry abe5bb884b viewer: prevent crash when headers are nil
Prevent the following error from happening:

Error: runtime error: invalid memory address or nil pointer dereference

panic({0x11206c0?, 0x18dd700?})
	runtime/panic.go:792 +0x132
git.sr.ht/~rjarry/aerc/lib/auth.New.CreateParser.func1(0x0, {0x0, 0x0, 0x0})
	                                               ^^^
	git.sr.ht/~rjarry/aerc/lib/auth/auth.go:77 +0xdb
git.sr.ht/~rjarry/aerc/app.NewMessageViewer.func2(...)
	git.sr.ht/~rjarry/aerc/app/msgviewer.go:93 +0x517
git.sr.ht/~rjarry/aerc/app.HeaderLayout.grid(...)
	git.sr.ht/~rjarry/aerc/app/headerlayout.go:39 +0x19e
git.sr.ht/~rjarry/aerc/app.NewMessageViewer(...)
	git.sr.ht/~rjarry/aerc/app/msgviewer.go:72 +0x185
git.sr.ht/~rjarry/aerc/commands/account.ViewMessage.Execute.func1(...)
	git.sr.ht/~rjarry/aerc/commands/account/view.go:68 +0x95
git.sr.ht/~rjarry/aerc/lib.NewMessageStoreView.func1(...)
	git.sr.ht/~rjarry/aerc/lib/messageview.go:80
git.sr.ht/~rjarry/aerc/lib.NewMessageStoreView(...)
	git.sr.ht/~rjarry/aerc/lib/messageview.go:127 +0x3e5
git.sr.ht/~rjarry/aerc/commands/account.ViewMessage.Execute(...)
	git.sr.ht/~rjarry/aerc/commands/account/view.go:57 +0x3c5
git.sr.ht/~rjarry/aerc/commands.ExecuteCommand(...)
	git.sr.ht/~rjarry/aerc/commands/commands.go:218 +0x73d
main.execCommand(...)
	git.sr.ht/~rjarry/aerc/main.go:45 +0x69
git.sr.ht/~rjarry/aerc/app.(*Aerc).BeginExCommand.func1(...)
	git.sr.ht/~rjarry/aerc/app/aerc.go:645 +0x5e
git.sr.ht/~rjarry/aerc/app.(*ExLine).Event(...)
	git.sr.ht/~rjarry/aerc/app/exline.go:92 +0xb82
git.sr.ht/~rjarry/aerc/app.(*Aerc).Event(...)
	git.sr.ht/~rjarry/aerc/app/aerc.go:344 +0x87e
git.sr.ht/~rjarry/aerc/app.(*Aerc).simulate(...)
	git.sr.ht/~rjarry/aerc/app/aerc.go:315 +0x2ae
git.sr.ht/~rjarry/aerc/app.(*Aerc).Event(...)
	git.sr.ht/~rjarry/aerc/app/aerc.go:377 +0xc45
git.sr.ht/~rjarry/aerc/lib/ui.HandleEvent(...)
	git.sr.ht/~rjarry/aerc/lib/ui/ui.go:188 +0x5e9
main.main()
	git.sr.ht/~rjarry/aerc/main.go:298 +0x11b4

Do not try to build an auth header set if the message headers are nil.

Reported-by: Moritz Poldrack <moritz@poldrack.dev>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Simon Martin <simon@nasilyan.com>
2025-08-05 11:52:47 +02:00
..
account-wizard.go wizard: add a spinner 2025-02-14 13:50:28 +01:00
account.go app: expose toggle-headers command for open split 2025-06-20 09:01:57 +02:00
aerc.go app: handle Vaxis FocusIn and FocusOut events 2025-08-04 12:03:46 +02:00
app.go viewer: disable passthrough mode on pager exit 2025-03-06 09:59:32 +01:00
authinfo.go lint: update golangci-lint to 1.61.0 2024-09-20 09:23:36 +02:00
compose.go chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
dialog.go aerc: add quake-mode terminal 2024-10-08 12:45:21 +02:00
dirlist.go chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
dirtree.go account: allow globs in folders-sort 2025-05-07 17:13:23 +02:00
exline.go textinput: make completions run async with cancellation 2024-10-24 22:13:51 +02:00
getpasswd.go lint: update golangci-lint to 1.61.0 2024-09-20 09:23:36 +02:00
headerlayout.go widgets: rename package to app 2023-10-10 11:37:56 +02:00
listbox.go menu: small usability improvements 2025-05-21 18:29:00 +02:00
msglist.go viewer: avoid crashes on opening invalid messages 2024-10-22 19:44:36 +02:00
msgviewer.go viewer: prevent crash when headers are nil 2025-08-05 11:52:47 +02:00
partswitcher.go mouse: use vaxis mouse events 2024-02-12 13:48:56 +01:00
pgpinfo.go lint: update golangci-lint to 1.61.0 2024-09-20 09:23:36 +02:00
providesmessage.go treewide: replace uint32 uids with opaque strings 2024-08-28 12:06:01 +02:00
quake.go aerc: add quake-mode terminal 2024-10-08 12:45:21 +02:00
scrollable.go chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
selector.go chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
spinner.go log: move package to lib 2024-02-14 23:04:38 +01:00
status.go templates: add visual mode indicator to TrayInfo 2024-03-04 22:33:15 +01:00
terminal.go term: allow setting custom title for the terminal tab 2025-05-05 13:49:04 +02:00