diff options
author | Daniel Milde <daniel@milde.cz> | 2024-04-01 18:01:43 +0200 |
---|---|---|
committer | Daniel Milde <daniel@milde.cz> | 2024-04-10 17:39:58 +0200 |
commit | 5c3e3912e049e2883be2c06bdb1fd4b01973d618 (patch) | |
tree | f4b7e9678cc0ee37e4553aab9376cc81e4c13171 /tui/background.go | |
parent | 16009ceb16298f37f948f0d44bae8b8bc3d66afb (diff) |
fix: handle panics in delete workers
Diffstat (limited to 'tui/background.go')
-rw-r--r-- | tui/background.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tui/background.go b/tui/background.go index c62d005..8f32c1a 100644 --- a/tui/background.go +++ b/tui/background.go @@ -17,6 +17,13 @@ func (ui *UI) queueForDeletion(items []fs.Item, shouldEmpty bool) { } func (ui *UI) deleteWorker() { + defer func() { + if r := recover(); r != nil { + ui.app.Stop() + panic(r) + } + }() + for item := range ui.deleteQueue { ui.deleteItem(item.item, item.shouldEmpty) } |