mirror of
https://git.sr.ht/~rjarry/aerc
synced 2025-11-05 00:21:54 +01:00
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>
|
||
|---|---|---|
| .. | ||
| borders.go | ||
| box.go | ||
| context.go | ||
| fill.go | ||
| grid.go | ||
| interfaces.go | ||
| popover.go | ||
| stack.go | ||
| string.go | ||
| tab.go | ||
| table.go | ||
| text.go | ||
| textinput.go | ||
| textinput_test.go | ||
| ui.go | ||