1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2025-10-13 20:05:15 +02:00
aerc/lib
Simon Martin a57e783008 grid: fix crash upon mouse event on not yet drawn grid
If you start aerc with mouse mode activated and you happen to touch the
mouse, you might encounter this crash [1].

The problem is that if the grid has not been drawn yet, reflow has not
been called, hence {row,column}Layout is nil, and we crash accessing
their elements.

There might be ways to better synchronize things (?), but the easiest is
to simply ignore mouse events if {row,column}Layout is nil; this is what
this patch does.

[1] panic: runtime error: slice bounds out of range [:2] with capacity 0
goroutine 1 [running]:
git.sr.ht/~rjarry/aerc/lib/log.PanicHandler()
        git.sr.ht/~rjarry/aerc/lib/log/panic-logger.go:51 +0x6cf
panic({0xc8c660?, 0xc001914000?})
        runtime/panic.go:792 +0x132
git.sr.ht/~rjarry/aerc/lib/ui.(*Grid).MouseEvent(0xc000162090, 0x63, 0x16, {0xc9ac60?, 0xc000414440?})
        git.sr.ht/~rjarry/aerc/lib/ui/grid.go:144 +0x5a6
git.sr.ht/~rjarry/aerc/app.(*AccountView).MouseEvent(0x142db50?, 0xcd1640?, 0xc0000478f0?, {0xc9ac60?, 0xc000414440?})
        git.sr.ht/~rjarry/aerc/app/account.go:192 +0x25
[...]

Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2025-09-26 16:54:32 +02:00
..
auth lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
autoconfig chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
calendar calendar: make invitation matching case-insensitive 2024-02-11 21:24:18 +01:00
crypto reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
format ui: properly trim spaces from addresses 2025-05-21 18:30:55 +02:00
hooks reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
ipc treewide: fix English spelling 2025-01-21 13:39:01 +01:00
iterator treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
jwz lib: vendor-in the jwz library 2025-08-28 09:28:16 +02:00
log treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
marker chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
notmuch codespell: fix lib/notmuch/directory.go: firs => first 2025-02-01 10:06:41 +01:00
pama chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
parse treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
pinentry reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
rfc822 rfc822: try harder to decode invalid address headers 2025-05-07 17:13:23 +02:00
send smtp: add option to request DSN for successful deliveries 2025-03-09 00:40:38 +01:00
sort treewide: replace uint32 uids with opaque strings 2024-08-28 12:06:01 +02:00
state reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
templates ui: properly trim spaces from addresses 2025-05-21 18:30:55 +02:00
ui grid: fix crash upon mouse event on not yet drawn grid 2025-09-26 16:54:32 +02:00
watchers watchers: fix checking error on darwin 2025-03-30 21:33:20 +02:00
xdg history: read the history file from XDG_STATE_HOME 2024-10-24 22:13:51 +02:00
attachment.go attach: fix content-transfer-encoding for rfc822 attachments 2024-10-24 22:13:51 +02:00
dirstore.go dirstore: list the folders in arrival order 2023-05-28 18:21:26 +02:00
dirstore_test.go dirstore: list the folders in arrival order 2023-05-28 18:21:26 +02:00
emlview.go rfc822: parse multipart messages on a best efforts basis 2024-11-21 22:27:19 +01:00
history.go Add command history and cycling 2019-07-26 14:29:34 -04:00
keepalive_dummy.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
keepalive_linux.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
messageview.go chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
msgstore.go chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
notmuch_version.go main: improve version string 2024-02-01 00:59:01 +01:00
notmuch_version_dummy.go main: improve version string 2024-02-01 00:59:01 +01:00
oauthbearer.go lint: work nicely with wrapped errors (errorlint) 2022-08-04 21:58:04 +02:00
open.go reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
structure_helpers.go lib: introduce FindMIMEPart, adapt Find{Plain,Calendar}text 2023-12-30 15:42:09 +01:00
structure_helpers_test.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
threadbuilder.go lib: vendor-in the jwz library 2025-08-28 09:28:16 +02:00
xoauth2.go xdg: get rid of deprecated dependencies 2023-08-27 18:44:12 +02:00